module TableHelper

Public Instance Methods

table(*headers, &block) click to toggle source
# 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