Created
May 10, 2010 20:41
-
-
Save tubbo/396503 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| private | |
| def mobile_device? | |
| if session[:mobile_param] | |
| session[:mobile_param] == '1' | |
| else | |
| request.user_agent =~ /Mobile|webOS/ | |
| end | |
| end | |
| helper_method :mobile_device? | |
| def prepare_for_mobile | |
| session[:mobile_param] = params[:mobile] if params[:mobile] | |
| format :mobi if mobile_device? | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment