devise_helper.rb 301 B

1234567891011121314
  1. module DeviseHelper
  2. def devise_error_messages!
  3. return '' if resource.errors.empty?
  4. messages = resource.errors.full_messages.map { |msg| content_tag(:div, msg) }.join
  5. html = <<-HTML
  6. <div class="alert alert-danger">
  7. #{messages}
  8. </div>
  9. HTML
  10. html.html_safe
  11. end
  12. end