1
validates_presence_of :match,
:message => "for your name and password could not be found. Did you #{link_to "forget your password", help_person_path}?"
這就是我想要做的。我可以插入模型中設置的變量,但使用簡單的Rails代碼(如「link_to」)似乎不起作用。這是一個無賴。如何在驗證消息中包含rails代碼?
我不會。我發現在登錄頁面上可能只有一個錯誤,所以我只是不顯示模型錯誤並在我的視圖中生成錯誤消息。 – chadoh 2010-09-08 11:08:01