diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5393f68..b505420 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -467,8 +467,9 @@ class ApplicationController < ActionController::Base end def prepare_for_mobile - if @site.mobile_on - session[:mobile_param] = if request.path =~ /mobile/ + if (@site.mobile_on.eql?(true) && mobile_device?) + mobile_path = "/mobile" + session[:mobile_param] = if request.path.eql?(mobile_path) '1' elsif params[:mobile] params[:mobile] @@ -476,8 +477,9 @@ class ApplicationController < ActionController::Base session[:mobile_param] end request.format = :mobile if mobile_device? - else - session[:mobile_param] = if request.path =~ /app/ + elsif (@site.mobile_on.eql?(false) && mobile_device?) + mobile_path = "/mobile/app" + session[:mobile_param] = if request.path.eql?(mobile_path) '1' elsif params[:mobile] params[:mobile]