From 2d29493f1a52216b96e43700dec4f80184be5a61 Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Wed, 9 Apr 2014 14:10:25 +0800 Subject: [PATCH] Identify device when identifying the root path --- app/controllers/application_controller.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5230135..9e98ade 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -474,7 +474,7 @@ class ApplicationController < ActionController::Base session[:mobile_param] = if request.path.eql?(@mobile_path) '1' - elsif request.path.eql?(root_path) + elsif (request.path.eql?(root_path) && mobile_device?) redirect_to mobile_path elsif params[:mobile] params[:mobile] @@ -501,9 +501,8 @@ class ApplicationController < ActionController::Base session[:mobile_param] = if (request.path.eql?(@mobile_path)) '1' - elsif request.path.eql?(root_path) - redirect_to mobile_path - elsif request.path.eql?(@mobile_app_path) + + elsif (request.path.eql?(@mobile_app_path) && mobile_device?) redirect_to root_path(mobile: 0) elsif params[:mobile] params[:mobile]