Sha256: ca2df73d324e35075629f031b1bb744e2d847dda2c53c8940eaa2f19a91fae0d
Contents?: true
Size: 711 Bytes
Versions: 12
Compression:
Stored size: 711 Bytes
Contents
module Trestle class Table class Automatic < Table def initialize(admin) super(sortable: true, admin: admin) end def columns content_columns + [actions_column] end def content_columns admin.default_table_attributes.map.with_index do |attribute, index| case attribute.type when :association Column.new(self, attribute.association_name, sort: false) else Column.new(self, attribute.name, link: index.zero?, align: (:center if [:datetime, :boolean].include?(attribute.type))) end end end def actions_column ActionsColumn.new(self) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems