Piece of code on github: http://bit.ly/ZMSJXQ
1) On Login, I get no error messages if:
devise_error_messages!
is empty as resource.errors
is empty.
Looks like resource doesn't get validated. Why?
2) If I run resource.valid?
then resource.errors
returns :email=>["has already been taken"], :password=>["can't be blank"]
I get error messages but they're not correct. 'Email has already been taken' doesn't make sense on log in. Why?
(Sign up, Reset password etc. work fine.)
devise_error_messages!
is only a helper to return a formatted list of resource.errors
. Some devise failure messages are set in rails's flash object though. Somewhere in your layout you should render those flash messages:
<%- flash.each do |name, msg| -%>
<%= content_tag :div, msg, id: "flash_#{name}" %>
<%- end -%>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With