Skip to content

Instantly share code, notes, and snippets.

@benlieb
Created January 14, 2014 23:16
Show Gist options
  • Save benlieb/8427858 to your computer and use it in GitHub Desktop.
Save benlieb/8427858 to your computer and use it in GitHub Desktop.
map.resources :products, :collection => { :notify => :post } do |products|
products.resources :orders,
:member => {
:change_payment => :get,
:invoice => :get,
:pricing => :get
},
:collection => {
:pre => :any,
:new => :post
}
end
resources :products do
post :notify, on: :collection
resources :orders do
member do
get :change_payment
get :invoice
get :pricing
end
collection do
post :new
match :pre, via: :all
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment