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