8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/bootstrap_forms/form_builder.rb', line 8
def error_messages
if object.try(:errors) and object.errors.full_messages.any?
content_tag(:div, :class => 'alert alert-block alert-error validation-errors') do
content_tag(:h4, I18n.t('bootstrap_forms.errors.header', :model => object.class.model_name.human), :class => 'alert-heading') +
content_tag(:ul) do
object.errors.full_messages.map do |message|
content_tag(:li, message)
end.join('').html_safe
end
end
else
'' end
end
|