Skip to content

table builder and description list (dl) helper for Rails / ActiveModels

License

Notifications You must be signed in to change notification settings

Narazaka/record_view_helper

Repository files navigation

Gem Gem Inch CI Ruby

table builder and description list (dl) helper for Rails / ActiveModels

Usage

/ on Rails
/ foo.html.slim

= table_for(@bars) do |s|
  - s.only :id, :name, :kind, :foo_id
  - s.link :id, :bar_path
  - s.link :foo_id, :foo_path
  - s.format :foo_id, [:foo_id, [:foo, :name]]
  - s.format :kind do |record|
    = Foo::KIND[record.kind]

= dl_for(@foo, except: [:created_at, :updated_at])

see API Documents for details

Installation

Add this line to your application's Gemfile:

gem "record_view_helper"

And then execute:

$ bundle

Or install it yourself as:

$ gem install record_view_helper

See also

License

The gem is available as open source under the terms of the Zlib License.