Class: Forme::InputsWrapper::Bs5Table
- Inherits:
-
Object
- Object
- Forme::InputsWrapper::Bs5Table
- Defined in:
- lib/forme/bs5.rb
Overview
Use a
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/forme/bs5.rb', line 100 def call(form, opts, &block) attr = opts[:attr] ? opts[:attr].dup : { :class=>'table table-bordered'} form.tag(:table, attr) do if legend = opts[:legend] form.tag(:caption, opts[:legend_attr], legend) end if (labels = opts[:labels]) && !labels.empty? form.tag(:tr, {}, labels.map{|l| form._tag(:th, {}, l)}) end yield end end |