From 0596f5345d6139ee28c9bec0a22af3b624dd481d Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Mon, 18 Jun 2012 22:50:15 +0200 Subject: [PATCH] use default format in case a tablet device is detected --- Gemfile.lock | 6 +++--- app/controllers/application_controller.rb | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2db66e19e..985408116 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -227,7 +227,7 @@ GEM i18n-inflector (~> 2.6) railties (~> 3.0) jasmine-core (1.2.0) - journey (1.0.3) + journey (1.0.4) jquery-rails (2.0.2) railties (>= 3.2.0, < 5.0) thor (~> 0.14) @@ -307,7 +307,7 @@ GEM rack-cors (0.2.6) rack rack-google-analytics (0.10.0) - rack-mobile-detect (0.3.0) + rack-mobile-detect (0.4.0) rack rack-piwik (0.1.2) rack-pjax (0.5.9) @@ -428,7 +428,7 @@ GEM daemons (>= 1.0.9) eventmachine (>= 0.12.6) rack (>= 1.0.0) - thor (0.15.2) + thor (0.15.3) tilt (1.3.3) timecop (0.3.5) treetop (1.4.10) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 456be84a7..746500031 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,6 +10,7 @@ class ApplicationController < ActionController::Base before_filter :set_locale before_filter :set_git_header if (AppConfig[:git_update] && AppConfig[:git_revision]) before_filter :set_grammatical_gender + before_filter :tablet_device_falback inflection_method :grammatical_gender => :gender @@ -105,6 +106,11 @@ class ApplicationController < ActionController::Base @grammatical_gender || nil end + def tablet_device_falback + # we currently don't have any special tablet views... + request.format = :html if is_tablet_device? + end + def after_sign_in_path_for(resource) stored_location_for(:user) || current_user_redirect_path end