RecordViewHelper

Gem Gem Gemnasium Inch CI Travis Build Status AppVeyor Build Status

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 MIT License.