Routes ExampleApp::Application.routes.draw do resources :pages, only: %w(show) resources :products, only: %w(index show) match ‘search/:term’ => ‘searches#index’ root to: ‘home#show’ end
REST Method Path Controller Action GET /tasks tasks index GET /tasks/new tasks new POST /tasks tasks create GET /tasks/:id tasks show GET /tasks/:id/edit tasks edit PUT /tasks/:id tasks update DELETE /tasks/:id tasks delete
Method Path Shows Action GET /tasks/1 html show GET /tasks/1.xml xml show GET /tasks/1.json json show GET /tasks/1.print html show PUT /tasks/1 redirect update PUT(xhr) /tasks/1 html/js update PUT /tasks/1.json json update Url formats