Sha256: e2aa405315bb0c79eb5e330477fc3a03c926f1f3e244bf5f1f06084ade33ec91

Contents?: true

Size: 785 Bytes

Versions: 2

Compression:

Stored size: 785 Bytes

Contents

DetectMobiles
=============

!!! Also detects iPhone and iPod Touch, now !!!

This plugin provides an instance method to ActionController::Base which 
can be used as a before_filter. The filter scans the request for 
indication of a mobile browser or an iPhone/iPod and then sets 
request.format to either :mobile or :iphone. This can be used in the 
responds_to block and in the views.

Usage Example
=============
install the gem
add the gem to your config/environment.rb
->  config.gem "detect_mobiles"
add the before_filter to your controller

class ApplicationController < ActionController::Base
  before_filter :detect_mobiles
end

now, the request.format will be changed to :mobile/:iphone depending on 
the browser. 


Copyright (c) 2008 Alex P, released under the MIT license

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aaalex-detect_mobiles-0.0.2 README
aaalex-detect_mobiles-0.0.3 README