Sha256: 27145c1ce40be01388aada509c38fa2b13c0cc3f06cfdb6389c01fcbfda32abc
Contents?: true
Size: 875 Bytes
Versions: 9
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 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 display 'Tables' 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
9 entries across 9 versions & 1 rubygems