Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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