Sha256: 5064cfd762b30a545034c21ada52bd91a80bf66e390fbf6767f2bab7ab012f26

Contents?: true

Size: 1.64 KB

Versions: 4

Compression:

Stored size: 1.64 KB

Contents

Spree::Core::Engine.add_routes do
  scope '(:locale)', locale: /#{Spree.available_locales.join('|')}/, defaults: { locale: nil } do
    root to: 'home#index'

    resources :products, only: [:index, :show], path: '/products'

    get '/products/:id/related', to: 'products#related'
    # route globbing for pretty nested taxon and product paths
    get '/t/*id', to: 'taxons#show', as: :nested_taxons
    get '/product_carousel/:id', to: 'taxons#product_carousel'

    # non-restful checkout stuff
    patch '/checkout/update/:state', to: 'checkout#update', as: :update_checkout
    get '/checkout/:state', to: 'checkout#edit', as: :checkout_state
    get '/checkout', to: 'checkout#edit', as: :checkout

    resources :orders, except: [:index, :new, :create, :destroy]

    resources :addresses, except: [:index, :show]

    get '/cart', to: 'orders#edit', as: :cart
    patch '/cart', to: 'orders#update', as: :update_cart
    put '/cart/empty', to: 'orders#empty', as: :empty_cart

    get '/content/cvv', to: 'content#cvv', as: :cvv
    get '/content/test', to: 'content#test'
    get '/cart_link', to: 'store#cart_link', as: :cart_link
    get '/account_link', to: 'store#account_link', as: :account_link

    get '/locales', to: 'locale#index', as: :locales
    get '/locale/set', to: 'locale#set', as: :set_locale
    get '/currency/set', to: 'currency#set', as: :set_currency

    get '/api_tokens', to: 'store#api_tokens'
    post '/ensure_cart', to: 'store#ensure_cart'

    get '/pages/:slug', to: 'cms_pages#show', as: :page

    get '/forbidden', to: 'errors#forbidden', as: :forbidden
    get '/unauthorized', to: 'errors#unauthorized', as: :unauthorized
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree_frontend-4.7.0 config/routes.rb
spree_frontend-4.6.0 config/routes.rb
spree_frontend-4.5.0 config/routes.rb
spree_frontend-4.4.0 config/routes.rb