Skip to content

Instantly share code, notes, and snippets.

@dhonig
Created September 21, 2015 21:46
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 dhonig/33ff0b178431a7477a8f to your computer and use it in GitHub Desktop.
Save dhonig/33ff0b178431a7477a8f to your computer and use it in GitHub Desktop.
Rails.application.routes.draw do
# This line mounts Spree's routes at the root of your application.
# This means, any requests to URLs such as /products, will go to Spree::ProductsController.
# If you would like to change where this engine is mounted, simply change the :at option to something different.
#
# We ask that you don't use the :as option here, as Spree relies on it being the default of "spree"
mount Spree::Core::Engine, :at => '/'
Spree::Core::Engine.add_routes do
namespace :api do
get '/orders/current_for/:id', to: 'orders#current_for'
resources :shipments, only: [:show]
resources :shipments, only: [:create, :update] do
collection do
post 'transfer_to_shipment'
end
end
resources :orders do
resources :line_items do
resources :blue_apron_gifts, only: [:create]
resources :blue_apron_recurring_preferences, only: [:create]
end
end
end
namespace :admin do
resources :orders do
member do
get 'blue_apron_details'
get 'audits'
end
end
resources :products do
member do
get 'audits'
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment