Sha256: ffc4a21573c28ace6de86ddde63f3d6bc038fead2b93e3a4e66f28fba602c772

Contents?: true

Size: 875 Bytes

Versions: 5

Compression:

Stored size: 875 Bytes

Contents

require_relative '../helpers/indented_grid'

Voom::Presenters.define(:tables) do
  helpers Demo::Helpers::IndentedGrid
  attach :top_nav
  attach :component_drawer
  page_title 'Tables'

  helpers do
    def items
      [
          OpenStruct.new(material: 'Acrylic (Transparent)', quantity: 50, price: '$2.90'),
          OpenStruct.new(material: 'Plywood (Birch)', quantity: 10, price: '$1.25'),
          OpenStruct.new(material: 'Laminate (Gold on Blue)', quantity: 50, price: '$2.35')
      ]
    end
  end

  indented_grid do
    table selectable: true do
      header do
        column 'Material'
        column 'Quantity'
        column 'Unit price'
      end

      items.each do |item|
        row do
          column item.material
          column item.quantity
          column item.price
        end
      end
    end

    attach :code, file: __FILE__
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
voom-presenters-0.1.13 app/demo/components/tables.pom
voom-presenters-0.1.12 app/demo/components/tables.pom
voom-presenters-0.1.11 app/demo/components/tables.pom
voom-presenters-0.1.10 app/demo/components/tables.pom
voom-presenters-0.1.9 app/demo/components/tables.pom