16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/helpers/sufia/sufia_helper_behavior.rb', line 16
def error_messages_for(object)
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('sufia.errors.header', model: object.class.model_name.human.downcase), 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
|