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
243 def call(form, opts, &block)
244   attr = opts[:attr] ? opts[:attr].dup : { :class=>'table table-bordered'}
245   form.tag(:table, attr) do
246     if legend = opts[:legend]
247       form.tag(:caption, opts[:legend_attr], legend)
248     end
249 
250     if (labels = opts[:labels]) && !labels.empty?
251       form.tag(:tr, {}, labels.map{|l| form._tag(:th, {}, l)})
252     end
253 
254     yield
255   end
256 end