Sha256: 8ab4337bfce2b37b4f0525366425fd417192a95f816d7e5945b364111a09e430
Contents?: true
Size: 1.24 KB
Versions: 19
Compression:
Stored size: 1.24 KB
Contents
# Collection Table The _Collection Table_ component provides a vertical table containing a collection of items. Use with _Active Record_ model instances, an array of objects that extend `ActiveModel::Naming`, or simple hash-like objects. Field types are automatically inferred from their respective database columns and rendered using an appropriate formatter. Pagination (provided by [Kaminari](https://github.com/kaminari/kaminari)) is enabled by default for larger collections. See the [full keyword argument specification](options.html) for information on the various available options. ```rspec:html collection = [ User.new(name: 'John', email: 'john@example.com', enabled: true), User.new(name: 'Jane', email: 'jane@example.org', enabled: false), User.new(name: 'Peter', email: 'peter@example.org', enabled: false), User.new(name: 'Sally', email: 'sally@example.org', enabled: true) ] subject do active_element.component.table collection: collection, fields: [:name, :email, :enabled], show: true, new: true, edit: true, destroy: true end it { is_expected.to include 'John' } ```
Version data entries
19 entries across 19 versions & 1 rubygems