From 9fecdd9739d67ae9789caa7f07ccd8c776c210e0 Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Mon, 7 Apr 2014 12:26:37 +0800 Subject: [PATCH] Updated mobile settings with /mobile and /mobile/app separate --- app/controllers/application_controller.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b505420..83b8bc3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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