Module: TableHelper
- Defined in:
- lib/generators/katapult/views/templates/app/helpers/table_helper.rb
Instance Method Summary collapse
Instance Method Details
#table(*headers, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/generators/katapult/views/templates/app/helpers/table_helper.rb', line 3 def table(*headers, &block) thead = content_tag(:thead) do content_tag(:tr) do headers.map{ |h| content_tag :th, h }.xss_aware_join end end rest = capture(&block) content_tag :table, thead + rest, class: 'table table-hover' end |