Module: ErrorsHelper

Defined in:
app/helpers/errors_helper.rb

Instance Method Summary collapse

Instance Method Details

#error_messages_for(form, opts = {}) ⇒ Object



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

def error_messages_for(form, opts={})
  unless form.errors.blank?
    html = "<div class='form-error-messages'>\n
            \t\t<h4>#{master.errors.count} #{t('drexed_errors.errors_pending', count: master.errors.count)}</h4>\n
            \t\t<ul class='list-unstyled'>\n"
    form.errors.full_messages.each do |error|
      html << "\t\t\t<li>#{error}</li>\n"
    end
    html << "\t\t</ul>\n
            \t</div>\n"
    html.html_safe
  end
end