jasonswett / angular-for-rails-developers-issues

Issues found in Angular for Rails Developers book
https://www.angularonrails.com/angular-rails-developers/
5 stars 1 forks source link

Page 25: Rails routes not set up yet #5

Open neeklamy opened 8 years ago

neeklamy commented 8 years ago

We’re told about the http://localhost:3000/api/books.json URL on page 25, Adding some seed data, and to spin up the Rails server and check out the URL, but, we haven’t added the api route to routes.rb yet.

Happily, http://localhost:3000/books.json works without any modification.

Page 26 has another mention of this URL when we’ve uploaded to Heroku (Heroku prints out a JSON formatted error, nice).

mantoniocc commented 8 years ago

You should add this to the route file:

scope '/api' do resources :books end