2
我正在使用Rails 3应用程序,并且需要在密码重发视图上调整错误消息。如果电子邮件地址的用户类型并提交,目前,该应用程序将显示此错误消息:Rails 3 /设计 - 更改密码重置的错误消息
Email not found
我需要改变这个错误消息是:
We don't have an account with that e-mail address. Maybe you used another address?
我知道,你可以在Devise YML文件中调整它,但不知道如何做到这一点...有什么建议吗?
工作守则
class PasswordsController < Devise::PasswordsController
def create
user = User.find_by_email(params[:user][:email])
if user.nil?
flash.now[:notice] = "We don't have an account with that e-mail address. Maybe you used another address?"
end
super
end
end
感谢的before_filter为您的建议!我在上面的工作代码中添加了 – dennismonsewicz