Class: Interview::FormErrors
- Defined in:
- lib/interview/form_errors.rb
Instance Attribute Summary
Attributes inherited from Control
Instance Method Summary collapse
Methods inherited from Control
#ancestors, build, definition, #find_attribute, #find_attribute!, inherited, #initialize, #set_attributes, #set_defaults
Constructor Details
This class inherits a constructor from Interview::Control
Instance Method Details
#render ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/interview/form_errors.rb', line 4 def render object = find_attribute!(:object) html = Builder::XmlMarkup.new if object.errors.any? html.div class: 'alert alert-danger' do html.h4 h.translate("errors.template.header", count: object.errors.count, model: object.class.model_name.human) html.ul do object.errors..each do |msg| html.li msg end end end end return html.target! end |