Class: Phlexi::Form::Components::FormErrors
- Defined in:
- lib/phlexi/form/components/form_errors.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(message, errors) ⇒ FormErrors
constructor
A new instance of FormErrors.
- #view_template ⇒ Object
Constructor Details
#initialize(message, errors) ⇒ FormErrors
Returns a new instance of FormErrors.
7 8 9 10 |
# File 'lib/phlexi/form/components/form_errors.rb', line 7 def initialize(, errors) @message = @errors = errors end |
Instance Method Details
#view_template ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/phlexi/form/components/form_errors.rb', line 12 def view_template div(class: themed(:form_errors_wrapper, nil), role: "alert") do div(class: themed(:form_errors_inner_wrapper, nil)) do p(class: themed(:form_errors_message, nil)) { @message } ul(class: themed(:form_errors_list, nil)) do @errors.each do |error| li(class: themed(:form_errors_list_item, nil)) { error.to_s } end end end end end |