im using twitters bootstrap alert messages. in my application.html.erb I have...
<% flash.each do |key, value| %>
Thing is that devise_error_messages!
by itself wraps the data into div with class='alert'
, so the form will have 2 nested divs with the same class. Pressing the x
button will close nested div, leaving empty div styled as alert
. To avoid this you can omit the div inside helper return value as following:
module DeviseHelper
def devise_error_messages!
return '' if resource.errors.empty?
messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
html = <<-HTML
#{messages}
HTML
html.html_safe
end
end