Module: Voidtools::FormHelpers
- Defined in:
- lib/voidtools/dm/form_helpers.rb
Instance Method Summary collapse
Instance Method Details
#error_messages_for(entity) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/voidtools/dm/form_helpers.rb', line 4 def (entity) obj = if entity.is_a? (Symbol) || entity.is_a?(String) instance_variable_get("@#{entity.to_s}") else entity end return nil if obj.errors.map{ |e| e } == [] haml_tag :ul, { class: "error_messages" } do obj.errors.map do |err| haml_tag(:li){ haml_concat err[0].to_s } end end end |