diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index eb0b768e2..06fc5e52a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -34,7 +34,13 @@ class ApplicationController < ActionController::Base # Overwriting the sign_out redirect path method def after_sign_out_path_for(resource_or_scope) - logged_out_path + # mobile_fu's is_mobile_device? wasn't working here for some reason... + # it may have been just because of the test env. + if request.env['HTTP_USER_AGENT'].match(/mobile/i) + root_path + else + logged_out_path + end end ##helpers diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 51b38d319..4188a98b0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -103,7 +103,7 @@ class UsersController < ApplicationController render "users/getting_started" end - def go_mobile + def logged_out if user_signed_in? redirect_to root_path end diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index 364a40fea..a7fd5503e 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -52,7 +52,7 @@ describe SessionsController do end it "redirects to / for a non-mobile user" do delete :destroy - response.should redirect_to root_path + response.should redirect_to logged_out_path end it "redirects to / for a mobile user" do