Class: FieldErrorTag
- Inherits:
-
LiquidumTag
- Object
- LiquidumTag
- FieldErrorTag
- Defined in:
- lib/scribo/liquid/tags/field_error_tag.rb
Overview
Add errors for a specific form field, only works inside a form
Basic usage:
{%field_error name%}
Instance Attribute Summary collapse
-
#field_type ⇒ Object
Returns the value of attribute field_type.
Instance Method Summary collapse
Instance Attribute Details
#field_type ⇒ Object
Returns the value of attribute field_type.
9 10 11 |
# File 'lib/scribo/liquid/tags/field_error_tag.rb', line 9 def field_type @field_type end |
Instance Method Details
#render(context) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/scribo/liquid/tags/field_error_tag.rb', line 11 def render(context) super = lookup(context, "form.errors.messages.#{argv1}") if .present? result = %[<span>] + attr_str(:class, arg(:class), input(:class, argv1)) + ( || []).join(', ') + %[</span>] end result end |