use default format in case a tablet device is detected

This commit is contained in:
Florian Staudacher 2012-06-18 22:50:15 +02:00
parent bccee23854
commit 0596f5345d
2 changed files with 9 additions and 3 deletions

View file

@ -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)

View file

@ -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