Class: Forme::InputsWrapper
- Inherits:
-
Object
- Object
- Forme::InputsWrapper
- Defined in:
- lib/forme.rb
Overview
Default inputs_wrapper used by the library, uses a <fieldset>.
Registered as :default.
Direct Known Subclasses
Defined Under Namespace
Classes: Div, FieldSetOL, OL, TR, Table
Instance Method Summary collapse
-
#call(form, opts) ⇒ Object
Wrap the inputs in a <fieldset>.
Instance Method Details
#call(form, opts) ⇒ Object
Wrap the inputs in a <fieldset>. If the :legend option is given, add a <legend> tag as the first child of the fieldset.
1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 |
# File 'lib/forme.rb', line 1166 def call(form, opts) attr = opts[:attr] ? opts[:attr].dup : {} Forme.attr_classes(attr, 'inputs') if legend = opts[:legend] form.tag(:fieldset, attr) do form.emit(form.tag(:legend, opts[:legend_attr], legend)) yield end else form.tag(:fieldset, attr, &Proc.new) end end |