From c0105e7cb8407d85e9937ac59b6ff79a76a8a5ff Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Tue, 18 Mar 2014 14:59:30 +0800 Subject: [PATCH] Changed Mobile App, fixed announcement default widget --- app/controllers/application_controller.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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]