Sha256: 2154012e68547ad405384215de1f4d4facff70141bd6c53ef21a28672e71d4b7

Contents?: true

Size: 625 Bytes

Versions: 3

Compression:

Stored size: 625 Bytes

Contents

# frozen_string_literal: true

module Tramway::Concerns::TableBuilder
  def table(**options, &block)
    content_tag(:table, class: 'table table-bordered table-striped', **options) do
      yield if block
    end
  end

  def thead(**options, &block)
    content_tag(:thead, **options) do
      yield if block
    end
  end

  def th(**options, &block)
    content_tag(:th, **options) do
      yield if block
    end
  end

  def td(**options, &block)
    content_tag(:td, **options) do
      yield if block
    end
  end

  def tr(**options, &block)
    content_tag(:tr, **options) do
      yield if block
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tramway-0.1.2 app/decorators/tramway/concerns/table_builder.rb
tramway-0.1.1.1 app/decorators/tramway/concerns/table_builder.rb
tramway-0.1.1 app/decorators/tramway/concerns/table_builder.rb