class Forme::InputsWrapper

Default inputs_wrapper used by the library, uses a <fieldset>.

Registered as :default.

Public Instance Methods

call(form, opts) { || ... } click to toggle source

Wrap the inputs in a <fieldset>. If the :legend option is given, add a <legend> tag as the first child of the fieldset.

   # File lib/forme/transformers/inputs_wrapper.rb
13 def call(form, opts, &block)
14   attr = opts[:attr] ? opts[:attr].dup : {}
15   Forme.attr_classes(attr, 'inputs')
16   if legend = opts[:legend]
17     form.tag(:fieldset, attr) do
18       form.tag(:legend, opts[:legend_attr], legend)
19       yield
20     end
21   else
22     form.tag(:fieldset, attr, &block)
23   end
24 end