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