Created
July 21, 2010 15:36
-
-
Save dougireton/484644 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
require 'rack/mobile-detect' | |
use Rack::MobileDetect | |
# set the Rails request.format (MIME type) to :iphone for iPhone/iPod Touch | |
# This allows us to serve separate layouts/views for iPhone/iPod | |
case request.headers['X_MOBILE_DEVICE'] | |
when /iPhone|iPod/ then request.format = :iphone | |
else | |
end | |
end | |
# this throws this error when I run Rails Server: | |
# Routing Error | |
# undefined local variable or method `request' for ApplicationController:Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment