class Forme::InputsWrapper::Bs3Table

  1. lib/forme/bs3.rb
Superclass: Object

Use a <table class=“table”> tag to wrap the inputs.

Registered as :bs3_table.

Methods

Public Instance

  1. call

Public Instance methods

call(form, opts, &block)

Wrap the inputs in a <table> tag.

[show source]
    # File lib/forme/bs3.rb
246 def call(form, opts, &block)
247   attr = opts[:attr] ? opts[:attr].dup : { :class=>'table table-bordered'}
248   form.tag(:table, attr) do
249     if legend = opts[:legend]
250       form.tag(:caption, opts[:legend_attr], legend)
251     end
252 
253     if (labels = opts[:labels]) && !labels.empty?
254       form.tag(:tr, {}, labels.map{|l| form._tag(:th, {}, l)})
255     end
256 
257     yield
258   end
259 end