Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed #9 #11 removed mobile user agent and fixed readme

  • Loading branch information...
commit 6e91e94888aa6f81b00b181757fc7e224503e23e 1 parent 411a492
@SentulAsia SentulAsia authored
Showing with 4 additions and 14 deletions.
  1. +3 −4 README.md
  2. +1 −10 lib/mobile-fu.rb
View
7 README.md
@@ -25,10 +25,9 @@ set as :mobile format. It is up to you to determine how you want to handle
these requests. It is also up to you to create the .mobile.erb versions of
your views that are to be requested.
-Then add the line below to config/initializers/mime_types.rb
-
- Mime::Type.register_alias "text/html", :mobile
- Mime::Type.register_alias "text/html", :tablet
+Mobile Fu automatically adds a new `:mobile` and `:tablet` to `text/html` mime type
+alias for Rails apps. If you already have a custom `:mobile` alias registered in
+`config/initializers/mime_types.rb`, you can remove that.
I recommend that you setup a before_filter that will redirect to a specific page
depending on whether or not it is a mobile request. How can you check this?
View
11 lib/mobile-fu.rb
@@ -31,18 +31,9 @@ class Railtie < Rails::Railtie
module ActionController
module MobileFu
- # These are various strings that can be found in mobile devices. Please feel free
- # to add on to this list.
- MOBILE_USER_AGENTS = 'palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|' +
- 'audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|' +
- 'x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|' +
- 'pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\\.b|' +
- 'webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|' +
- 'mobile'
-
# These are various strings that can be found in tablet devices. Please feel free
# to add on to this list.
- TABLET_USER_AGENTS = 'ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle'
+ TABLET_USER_AGENTS = 'ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle|honeycomb'
def self.included(base)
base.extend ClassMethods
Please sign in to comment.
Something went wrong with that request. Please try again.