Identify device when identifying the root path

This commit is contained in:
Saurabh Bhatia 2014-04-09 14:10:25 +08:00
parent 5f9d653598
commit 2d29493f1a
1 changed files with 3 additions and 4 deletions

View File

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