This example showing api of simple book and author relationship.
git clone https://github.com/chengjk84/book-store-api.git
cd book-store-api
rails db:create
rails db:migrate
rails db:seed
rails s
curl -L http://0.0.0.0:3000/api/v1/books | python -mjson.tool
curl -L http://0.0.0.0:3000/api/v1/authors | python -mjson.tool