diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cc03d95b43..8540ba7096 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -23,7 +23,7 @@ class ApplicationController < ActionController::Base referer_path = OpenFoodNetwork::RefererParser.path(request.referer) if referer_path is_checkout_path_the_referer = [main_app.checkout_path].include?(referer_path) - session["spree_user_return_to"] = is_checkout_path_the_referer ? referer_path : root_path + session["spree_user_return_to"] = is_checkout_path_the_referer ? referer_path : main_app.root_path end end @@ -52,7 +52,7 @@ class ApplicationController < ActionController::Base end def after_sign_out_path_for(_resource_or_scope) - session[:shopfront_redirect] || root_path + session[:shopfront_redirect] || main_app.root_path end private @@ -74,7 +74,7 @@ class ApplicationController < ActionController::Base def require_distributor_chosen unless @distributor = current_distributor - redirect_to spree.root_path + redirect_to main_app.root_path false end end diff --git a/app/controllers/spree/admin/base_controller.rb b/app/controllers/spree/admin/base_controller.rb index c1c0179133..dfd7fdba36 100644 --- a/app/controllers/spree/admin/base_controller.rb +++ b/app/controllers/spree/admin/base_controller.rb @@ -30,7 +30,7 @@ module Spree redirect_to '/unauthorized' else store_location - redirect_to root_path(anchor: "login?after_login=#{request.env['PATH_INFO']}") + redirect_to main_app.root_path(anchor: "login?after_login=#{request.env['PATH_INFO']}") end end diff --git a/app/controllers/spree/orders_controller.rb b/app/controllers/spree/orders_controller.rb index 400b6f4959..c7d4f1d8c9 100644 --- a/app/controllers/spree/orders_controller.rb +++ b/app/controllers/spree/orders_controller.rb @@ -71,7 +71,7 @@ module Spree @order = order_to_update unless @order flash[:error] = t(:order_not_found) - redirect_to(root_path) && return + redirect_to(main_app.root_path) && return end if @order.update_attributes(params[:order]) diff --git a/app/views/shared/_footer.html.haml b/app/views/shared/_footer.html.haml index 865c466582..310e9473b2 100644 --- a/app/views/shared/_footer.html.haml +++ b/app/views/shared/_footer.html.haml @@ -126,7 +126,7 @@ .row .small-12.medium-3.medium-offset-2.columns.text-left - %a{href: root_path} + %a{href: main_app.root_path} %img{src: ContentConfig.footer_logo.url, width: "220"} .small-12.medium-5.columns.text-left %p.text-small diff --git a/app/views/shared/menu/_large_menu.html.haml b/app/views/shared/menu/_large_menu.html.haml index aa814a2a36..fefdcadefe 100644 --- a/app/views/shared/menu/_large_menu.html.haml +++ b/app/views/shared/menu/_large_menu.html.haml @@ -2,7 +2,7 @@ %section.top-bar-section %ul.left %li.ofn-logo - %a{href: root_path} + %a{href: main_app.root_path} %img{src: ContentConfig.logo.url} %li.powered-by %img{src: '/favicon.ico'} diff --git a/app/views/shared/menu/_mobile_menu.html.haml b/app/views/shared/menu/_mobile_menu.html.haml index 707b448e52..c501d7b365 100644 --- a/app/views/shared/menu/_mobile_menu.html.haml +++ b/app/views/shared/menu/_mobile_menu.html.haml @@ -5,7 +5,7 @@ %section.left .ofn-logo - %a{href: root_path} + %a{href: main_app.root_path} %img{src: ContentConfig.logo_mobile.url, srcset: ContentConfig.logo_mobile_svg.url, width: "75", height: "26"} %section.right{"ng-cloak" => true} diff --git a/app/views/shared/menu/_offcanvas_menu.html.haml b/app/views/shared/menu/_offcanvas_menu.html.haml index c18d14d0e9..b6e553bc8c 100644 --- a/app/views/shared/menu/_offcanvas_menu.html.haml +++ b/app/views/shared/menu/_offcanvas_menu.html.haml @@ -1,7 +1,7 @@ %aside.left-off-canvas-menu.show-for-medium-down{ ng: { controller: "OffcanvasCtrl" } } %ul.off-canvas-list %li.ofn-logo - %a{href: root_path} + %a{href: main_app.root_path} %img{src: ContentConfig.logo_mobile.url, srcset: ContentConfig.logo_mobile_svg.url, width: "75", height: "26"} - [*1..7].each do |menu_number| - menu_name = "menu_#{menu_number}" diff --git a/app/views/spree/layouts/bare_admin.html.haml b/app/views/spree/layouts/bare_admin.html.haml index 39e87961f4..bc8b1868c1 100644 --- a/app/views/spree/layouts/bare_admin.html.haml +++ b/app/views/spree/layouts/bare_admin.html.haml @@ -1,6 +1,6 @@ %html{ lang: "en" } %head{"data-hook" => "admin_inside_head"}= render :partial => 'spree/admin/shared/head' - %body.admin{"data-ajax-root-path" => spree.root_path} + %body.admin{"data-ajax-root-path" => main_app.root_path} #wrapper{"data-hook" => ""} - if flash[:error] .flash.error= flash[:error] diff --git a/lib/spree/core/controller_helpers/auth_decorator.rb b/lib/spree/core/controller_helpers/auth_decorator.rb index 1c5f9de911..7342450c74 100644 --- a/lib/spree/core/controller_helpers/auth_decorator.rb +++ b/lib/spree/core/controller_helpers/auth_decorator.rb @@ -1,5 +1,5 @@ Spree::Core::ControllerHelpers::Auth.class_eval do def require_login_then_redirect_to(url) - redirect_to root_path(anchor: "login?after_login=#{url}") + redirect_to main_app.root_path(anchor: "login?after_login=#{url}") end end