diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index affab70c16..4b0cc37e9f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,8 +7,11 @@ class ApplicationController < ActionController::Base def after_sign_in_path_for(resource) - referer_path = URI(request.referer).path - [main_app.shop_checkout_path].include?(referer_path) ? referer_path : root_path + if request.referer and referer_path = URI(request.referer).path + [main_app.shop_checkout_path].include?(referer_path) ? referer_path : root_path + else + root_path + end end private diff --git a/spec/features/admin/cms_spec.rb b/spec/features/admin/cms_spec.rb index aec64cf291..c3b2fe3454 100644 --- a/spec/features/admin/cms_spec.rb +++ b/spec/features/admin/cms_spec.rb @@ -31,5 +31,4 @@ feature %q{ page.should_not have_content "ComfortableMexicanSofa" page.should have_content "WHERE WOULD YOU LIKE TO SHOP?" end - end