Class: SimpleForm::Errors
- Inherits:
-
Hash
- Object
- Hash
- SimpleForm::Errors
- Defined in:
- lib/simple_form/errors.rb
Instance Method Summary collapse
- #full_messages ⇒ Object
-
#initialize(base, *args) ⇒ Errors
constructor
A new instance of Errors.
- #on(attribute) ⇒ Object
Constructor Details
#initialize(base, *args) ⇒ Errors
Returns a new instance of Errors.
27 28 29 30 |
# File 'lib/simple_form/errors.rb', line 27 def initialize(base, *args) @base = base super(*args) end |
Instance Method Details
#full_messages ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/simple_form/errors.rb', line 42 def map do |attribute, | next if .nil? attribute = attribute.to_sym "#{@base.class.human_attribute_name(attribute)} #{(attribute, )}" end.compact.reverse end |
#on(attribute) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/simple_form/errors.rb', line 35 def on(attribute) attribute = attribute.to_sym return nil unless self[attribute] (attribute, self[attribute]) end |