Added a condition for mobile api false and mobile site on

This commit is contained in:
Saurabh Bhatia 2014-04-08 11:32:44 +08:00
parent 16e60dc697
commit 55faf97379
1 changed files with 15 additions and 4 deletions

View File

@ -481,8 +481,7 @@ class ApplicationController < ActionController::Base
end
request.format = :mobile if mobile_device?
elsif (@site.mobile_on.eql?(false) && @site.mobile_api_openness_on.eql?(true))
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)
@ -494,9 +493,21 @@ class ApplicationController < ActionController::Base
end
request.format = :mobile if mobile_device?
elsif (@site.mobile_on.eql?(true) && @site.mobile_api_openness_on.eql?(false))
session[:mobile_param] = if (request.path.eql?(@mobile_path))
'1'
elsif request.path.eql?(@mobile_app_path)
redirect_to root_path(mobile: 0)
elsif params[:mobile]
params[:mobile]
else
session[:mobile_param]
end
request.format = :mobile if mobile_device?
elsif (@site.mobile_on.eql?(false) && @site.mobile_api_openness_on.eql?(false))
mobile_app_path = "/mobile/app"
mobile_path = "/mobile"
session[:mobile_param] = if (request.path.eql?(@mobile_app_path))
redirect_to root_path(mobile: 0)
elsif request.path.eql?(@mobile_path)