Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hansottowirtz/elpong-rails
Elpong for Rails
https://github.com/hansottowirtz/elpong-rails
elpong json-api rails restful
Last synced: about 1 month ago
JSON representation
Elpong for Rails
- Host: GitHub
- URL: https://github.com/hansottowirtz/elpong-rails
- Owner: hansottowirtz
- License: mit
- Created: 2016-07-03T19:13:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-17T23:29:48.000Z (almost 8 years ago)
- Last Synced: 2024-11-16T09:07:35.401Z (about 1 month ago)
- Topics: elpong, json-api, rails, restful
- Language: Ruby
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Elpong for Rails
This library is meant for use with [Elpong for Javascript][js]
You can put a `scheme.json` in the `/config` folder, and
that will be used as the default scheme.```ruby
gem 'elpong-rails'
``````bash
$ rails generate elpong
``````ruby
class ApplicationController < ActionController::Base
helper Elpong::Rails::Helper
# this provides methods like elpong_scheme and elpong_collection
end
``````html
<%= elpong_scheme 'animal-farm' %>
<%= elpong_collection 'pigs', path: '/api/v1/pigs/index', locals: {pigs: @pigs} %>
<%= elpong_element 'user', path: '/api/v1/users/me', attributes: {'current-user': true} %>```
[js]: https://github.com/hansottowirtz/elpong-js