Module: DeviseHelper

Defined in:
app/helpers/devise_helper.rb

Instance Method Summary collapse

Instance Method Details

#devise_error_messages!Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/devise_helper.rb', line 3

def devise_error_messages!
  return '' if resource.errors.empty?

  messages = resource.errors.full_messages.map { |msg| (:li, msg) }.join
  html = <<-HTML
  <div class="alert alert-error alert-danger"> <button type="button"
  class="close" data-dismiss="alert">x</button>
    #{messages}
  </div>
  HTML

  html.html_safe
end