RailsCasts Pro episodes are now free!

Learn more or hide this

rdpoor's Profile

GitHub User: rdpoor

Comments by

Avatar

As written, the routes.rb file has something like this:

config/routes.rb
get "log_out" => "sessions#destroy", :as => "log_out"
get "log_in" => "sessions#new", :as => "log_in"
resources :sessions

The resources :sessions line defines the full set of RESTful routes for SessionsController, but because of the first two lines, you don't need them.

Am I correct?

Avatar

With the default routing:

ruby
 resources :products

you'll get routes for #new and #edit, which aren't used in a pure JSON interface. Is there a reason for NOT doing

ruby
 resources :products, :except => [:new, :edit]

?