Skip to content

Instantly share code, notes, and snippets.

@gourshete
Created June 26, 2019 14:37
Show Gist options
  • Save gourshete/6909e997f7d11ed2b9ddb4b046d50c58 to your computer and use it in GitHub Desktop.
Save gourshete/6909e997f7d11ed2b9ddb4b046d50c58 to your computer and use it in GitHub Desktop.
Expanded routes for resource books
# config/routes.rb
Rails.application.routes.draw do
# resources :books becomes...
get '/books' => 'books#index'
get '/books/new' => 'books#new'
post '/books' => 'books#create'
get '/books/:id' => 'books#show'
get '/books/:id/edit' => 'books#edit'
put '/books/:id' => 'books#update'
delete '/books/:id' => 'books#destroy'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment