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
229 def call(form, opts, &block)
230   attr = opts[:attr] ? opts[:attr].dup : { :class=>'table table-bordered'}
231   form.tag(:table, attr) do
232     if legend = opts[:legend]
233       form.emit(form.tag(:caption, opts[:legend_attr], legend))
234     end
235 
236     if (labels = opts[:labels]) && !labels.empty?
237       form.emit(form.tag(:tr, {}, labels.map{|l| form._tag(:th, {}, l)}))
238     end
239 
240     yield
241   end
242 end