https://github.com/narazaka/record_view_helper
table builder and description list (dl) helper for Rails / ActiveModels
https://github.com/narazaka/record_view_helper
form-builder html-builder rails table-builder
Last synced: 3 months ago
JSON representation
table builder and description list (dl) helper for Rails / ActiveModels
- Host: GitHub
- URL: https://github.com/narazaka/record_view_helper
- Owner: Narazaka
- License: zlib
- Created: 2017-03-04T03:28:04.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-20T09:16:15.000Z (about 4 years ago)
- Last Synced: 2024-11-26T13:14:27.449Z (3 months ago)
- Topics: form-builder, html-builder, rails, table-builder
- Language: Ruby
- Size: 54.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [RecordViewHelper](https://github.com/Narazaka/record_view_helper)
[](https://rubygems.org/gems/record_view_helper)
[](https://rubygems.org/gems/record_view_helper)
[](http://inch-ci.org/github/Narazaka/record_view_helper)
[](https://github.com/Narazaka/record_view_helper/actions?query=workflow:Ruby)table builder and description list (dl) helper for Rails / ActiveModels
## Usage
```slim
/ 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](http://www.rubydoc.info/gems/record_view_helper) for details
## Installation
Add this line to your application's Gemfile:```ruby
gem "record_view_helper"
```And then execute:
```bash
$ bundle
```Or install it yourself as:
```bash
$ gem install record_view_helper
```## See also
- [table-for](https://github.com/hunterae/table-for)
## License
The gem is available as open source under the terms of the [Zlib License](LICENSE).