title: How to display error messages for a devise form? Ruby on rails
body: <pre><code> &lt;%= form_for(resource, :as =&gt; resource_name, :url =&gt; session_path(resource_name)) do |f| %&gt;
        &lt;p&gt;&lt;%= f.label :email %&gt;&lt;br /&gt;
        &lt;%= f.email_field :email %&gt;&lt;/p&gt;
        &lt;p&gt;&lt;%= f.label :password %&gt;&lt;br /&gt;
        &lt;%= f.password_field :password %&gt;&lt;/p&gt;
   &lt;%= end =%&gt;
  </code></pre>
  
  <p>I am trying to create a basic login form.  I want to be able to display an error like "wrong user info" if the username or password is incorrect.  I looked at this post here:  <a href="https://stackoverflow.com/questions/17662089/form-for-error-messages-in-rails-4">form_for error messages in Ruby on Rails</a></p>
  
  <p>but it doesn't seem to work for devise forms?  </p>