table builder and description list (dl) helper for Rails / ActiveModels
/ 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
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
The gem is available as open source under the terms of the Zlib License.