Skip to content

Instantly share code, notes, and snippets.

@mori-dev
Forked from kozo002/routes.rb
Created August 6, 2012 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mori-dev/3274931 to your computer and use it in GitHub Desktop.
Save mori-dev/3274931 to your computer and use it in GitHub Desktop.
confirmationを使う場合にRESTfulっぽくなるようにしてみた
resources :products, only: [:index, :show]
namespace :products do
resources :registrations, only: [:new, :create, :edit, :update]
resources :confirmations, only: [:show, :update] do
get :completion, on: :collection
end
end
namespace :admin do
resources :products do
resource :acceptance, only: [:create, :destroy], module: :products
end
end
# GET /products
#
# GET /products/registrations/new
# POST /products/registrations
# GET /products/registrations/:id/edit
# PUT /products/registrations/:id
#
# GET /products/confirmations/:id
# PUT /products/confirmations/:id
# GET /products/confirmations/completion
#
# POST /admin/products/:product_id/acceptance
# DELETE /admin/products/:product_id/acceptance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment