ruby - How to do Error Message Interpolation in Rails with Devise? -
i have rails 3.2 app running devise 2.3. kept email address default authentication key. when user tries create new account existing email address, show him links login , reset password pages.
there answer question suggests how proceed in rails, doesn't solve problem when using devise. when trying define custom validation on email, server won't start. see pastebin.
is there way can override or hijack error message added devise use own instead? or there way add global interpolation values?
this message show:
taken: email used, please <a href='%{login_link}'>login</a> or <a href='%{reset_link}'>reset password</a>
the app tries display it, complains missing interpolation keys. how can assign interpolation keys devise handling validation on email?
this may not canonical example of problem, since application links static , hard-coding okay here. if other dynamic values interpolated?
try passing these user.rb file
validates :email, :uniqueness => {:login_link => rails.application.routes.url_helpers.new_user_session_path, :reset_link => rails.application.routes.url_helpers.new_user_password_path}
Comments
Post a Comment