Updated mobile settings with /mobile and /mobile/app separate

This commit is contained in:
Saurabh Bhatia 2014-04-07 12:26:37 +08:00
parent 3b489789ac
commit 9fecdd9739
1 changed files with 7 additions and 3 deletions

View File

@ -468,9 +468,10 @@ class ApplicationController < ActionController::Base
def prepare_for_mobile
if (@site.mobile_on.eql?(true) && mobile_device?)
mobile_app_path = "/mobile/app"
mobile_path = "/mobile"
session[:mobile_param] = if request.path.eql?(mobile_path)
'1'
'1'
elsif params[:mobile]
params[:mobile]
else
@ -478,9 +479,12 @@ class ApplicationController < ActionController::Base
end
request.format = :mobile if mobile_device?
elsif (@site.mobile_on.eql?(false) && mobile_device?)
mobile_path = "/mobile/app"
session[:mobile_param] = if request.path.eql?(mobile_path)
mobile_app_path = "/mobile/app"
mobile_path = "/mobile"
session[:mobile_param] = if request.path.eql?(mobile_app_path)
'1'
elsif request.path.eql?(mobile_path)
'0'
elsif params[:mobile]
params[:mobile]
else