Module: CellDecorators::ErrorMessage
- Defined in:
- lib/cell_decorators/error_message.rb
Overview
show error message to be used in form
Instance Method Summary collapse
- #display_red_border(attr) ⇒ Object
- #error_message?(attr) ⇒ Boolean
- #error_message_for(attr) ⇒ String
Instance Method Details
#display_red_border(attr) ⇒ Object
21 22 23 24 |
# File 'lib/cell_decorators/error_message.rb', line 21 def display_red_border(attr) return "b--red" if (attr) "" end |
#error_message?(attr) ⇒ Boolean
7 8 9 |
# File 'lib/cell_decorators/error_message.rb', line 7 def (attr) [:errors].present? && [:errors].keys.include?(attr.to_sym) end |
#error_message_for(attr) ⇒ String
13 14 15 16 17 18 19 |
# File 'lib/cell_decorators/error_message.rb', line 13 def (attr) if (attr) [:errors][attr.to_sym].to_sentence else nil end end |