Sha256: fb209970e823413e1b29cbfe1335e9510e9cd98e8e272dcafc63822f09a21ac9

Contents?: true

Size: 480 Bytes

Versions: 1

Compression:

Stored size: 480 Bytes

Contents

module SimpleDatatable
  module ApplicationHelper
    def simple_datatable(cols = [], html_options = {})
      html_options[:class] ||= ''
      html_options[:class] << 'dataTable'
      content_tag :table, html_options do
        content_tag :thead do
          content_tag :tr do
            cols.each_with_object('') do |col, html|
              html << content_tag(:th, col.capitalize)
            end.html_safe
          end
        end
      end.html_safe
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_datatable-0.0.1 app/helpers/simple_datatable/application_helper.rb