config/routes.rb in bodega-0.3.0 vs config/routes.rb in bodega-0.4.0
- old
+ new
@@ -1,16 +1,16 @@
Bodega::Engine.routes.draw do
# Building orders
- get '', as: :root, to: 'orders#new'
- post '', to: 'orders#create'
+ get '', as: :new_order, to: 'orders#new'
+ resource :order, only: :create, path: '' do
+ # Add products to an order
+ post :add, as: :add_to, to: 'orders#add'
+ get 'remove/:product_id', as: :remove_from, constraints: {product_id: /.+\.\d+/}, to: 'orders#remove'
- # Add products to an order
- post :add, to: 'orders#add'
- get 'remove/:product_id', as: :remove, constraints: {product_id: /.+\.\d+/}, to: 'orders#remove'
-
- # Processing orders
- get :complete, to: 'orders#complete'
- post :complete, to: 'orders#complete'
+ # Processing orders
+ get :complete, to: 'orders#complete'
+ post :complete, to: 'orders#complete'
+ end
# Existing orders
get ':id', as: :order, to: 'orders#show'
post ':id', to: 'orders#update'
end