Skip to content

tb/rails-json-api-react

Repository files navigation

Demo user: user1@example.com / Secret123

Setup app

bundle rake db:setup cd client && yarn 

Start app

foreman start open http://localhost:3000 

Adding new JSON API resource

rails g model category name:string rails generate jsonapi:resource category rails g controller Category --skip-assets 

routes.rb

jsonapi_resources :categories 

Client

Add list, edit and form components in client/src/components/ based on one of existing.

Categories

 { categories { id name } } 

Categories with posts

{ categories(with_posts: true) { id name posts { id title category { id name } comments { id body } } } } 

One category

{ category(id: 1) { id name } } 

Posts

{ posts { id title category { id name } } } 

One post

{ post(id: 1) { id title category { id name } comments { id body } } } 

About

React + JSON API Redux CRUD

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7

Languages