<%= render "devise/shared/error_messages", resource: @user %> is not working
The render is not working on my view as well as I tried it in a layout. But it displays nothing. Expected Output: When I put a wrong password of user it should display an error message Actual Output When I put a wrong password of user it refreshes the page and empties the password field while the email field remains unchanged
I am seeing the same behavior. A brand new rails app with latest Devise. On login page, if you click the Log In button leaving everything blank, the page simply reloads with no error messages or flash messages. May be I am completely missing something very basic?
Nevermind. Figured it out. Flash message is set, but it's of type :alert. My flash rendering was ignoring that type.
@hassamsaeed-qbatch do you have flash messages added to your template/layout? They are required in order to display some general error messages like "Invalid username or password" for example.
Try adding something like this in your layout and you should see those messages:
<%= notice || alert %>
Note: notice and alert are shortcuts for flash[:notice] and flash[:alert]
If this doesn't work, please report back with a sample app showing the problem and we can reopen.