Class: Forme::InputsWrapper::Bootstrap3

Inherits:
Object
  • Object
show all
Defined in:
lib/forme/bs3.rb

Overview

Use a <fieldset> tag to wrap the inputs.

Registered as :bs3.

Instance Method Summary collapse

Instance Method Details

#call(form, opts, &block) ⇒ Object



225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/forme/bs3.rb', line 225

def call(form, opts, &block)
  attr = opts[:attr] ? opts[:attr].dup : {}
  Forme.attr_classes(attr, 'inputs')
  if legend = opts[:legend]
    form.tag(:fieldset, attr) do
      form.tag(:legend, opts[:legend_attr], legend)
      yield
    end
  else
    form.tag(:fieldset, attr, &block)
  end
end