Hi everyone, I tried to follow the routes indicati...
# support
f
Hi everyone, I tried to follow the routes indication " # If you would like to change where this engine is mounted, simply change the :at option to something different. mount Spree:Core:Engine, at: '/' " mount Spree:Core:Engine, at: '/'store " doesn't work .... No route matches [GET] "/store"
r
Hi Fredj 👋 If I understand correctly, you want to add a global “namespace” to all routes of your frontend with something like:
<https://yourdomain/store/>..
If that’s the goal, you can do it by wrapping all the frontend route definitions in a dedicated scope. So in your
config/routes.rb
something like this:
Copy code
Rails.application.routes.draw do
  scope :store do
     .
     .
    resources :cart_line_items, only: :create

    get '/locale/set', to: 'locale#set'
    post '/locale/set', to: 'locale#set', as: :select_locale
    resource :checkout_session, only: :new
    resource :checkout_guest_session, only: :create
    .
    .
  end
end
f
Hi rainer, thanks for your answer, yes that's right but even with your solution, i stille have no route for
https://yourdomain/store/ how can i ssign a get method the route "store' ? : spree_path/ storeSpree:Core:Engine
how can i assign a get method to the route "store' ?
I would like to create an home page before arriving on /store. The home page works but not /store
ok, solved Rails.application.routes.draw do get "/", to: 'pages#home' scope :store do root to: 'home#index'
thank you !
🙌 1
not the good solution... do you know how i could do ? (my solution doesn't make working the other paths anymore)
ok found... Rails.application.routes.draw do root 'pages#home' get "/store", to: 'home#index'