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 = (:thead) do
    (:tr) do
      headers.map{ |h|  :th, h }.xss_aware_join
    end
  end
  rest = capture(&block)

   :table, thead + rest, class: 'table table-hover'
end