Fixing a nil bug in the referrer handling on login

This commit is contained in:
Will Marshall
2014-02-27 16:24:10 +11:00
parent 4a6c00e592
commit d6c71d5416
2 changed files with 5 additions and 3 deletions

View File

@@ -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

View File

@@ -31,5 +31,4 @@ feature %q{
page.should_not have_content "ComfortableMexicanSofa"
page.should have_content "WHERE WOULD YOU LIKE TO SHOP?"
end
end