How to change the start page in the Spree admin panel? The default page is / admin / orders, you need / admin / products. I try a redirect in the router, get '/ admin / orders', to: redirect ('/ admin / products') but the redirection is ignored.
1 answer
Locate the spree / backend / config / routes.rb file . At the end of this file there is a line
get Spree.admin_path, to: redirect(Spree.admin_path + '/orders'), as: :admin
You need to replace it with
get Spree.admin_path, to: redirect(Spree.admin_path + '/products'), as: :admin
To redefine the routes in your application, in the config / routes.rb file, define it before the mount point of the Engin Spree
routes
get Spree.admin_path, to: redirect(Spree.admin_path + '/products'), as: :admin mount Spree::Core::Engine, at: '/'
- Thank you for the answer, I did not find the lines you specified, but there is a get '/ admin' to and got what I wanted, but it confuses me that I have to edit the heme router (ruby-2.3.0 / gems / spree_backend-3.0.9 / config / routes.rb), I would like to be updated. Do not tell me if there is a method that does not affect the core of spree? - Taras Jolly
- @ TarasFunny supplemented the answer - cheops
- thank! Override the route turned out, but in my case the line looks like this: get '/ admin', to: 'spree / admin / products # index', as:: admin - Taras Vesely
- @TarasFunny So, without a redirect, even better. - cheops
|