0

In my application.html.erb file, I have

<% flash.each do |key,msg| %>
  <div class="message">
      <%= content_tag :div, msg %>
  </div>
<% end %>

Is there a way to make devise display it's error messages in there?

When I add <%= devise_error_messages! %> I get a undefined local variable or method 'resource' error.

user1919937
  • 455
  • 4
  • 9
  • 15
  • Maybe this post will help? http://stackoverflow.com/questions/4101641/rails-devise-handling-devise-error-messages?rq=1 – stew Jan 03 '13 at 21:58

2 Answers2

0

In application.html.erb file

<% [:notice,:error,:info,:success,:alert].each do |key| %>
  <div class="message">
    <%= flash[key] %>
  </div>
<% end %>
kader
  • 31
  • 1
  • 4
0

Just try to put a form_for with url so that devise will be able to check which resource it is referring to..

eg: <%form_for :post,:url=>post_path(@post) do |f|%>

UserROR
  • 240
  • 3
  • 12