Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Adds acts_as_mobile_controller to ActionController
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.bundle
lib
rails
test
.document
.gitignore
Gemfile
LICENSE
README.rdoc
Rakefile
VERSION
acts-as-mobile.gemspec
init.rb

README.rdoc

acts-as-mobile

Adds mobile-specific methods to ActionController and ActionView.

iPhone requests should reroute to format :mobile. iPad requests will remain :html, but can be tested for using the ipad? helper method

Usage

Gemfile

gem 'acts-as-mobile', :require => 'acts_as_mobile'

Controller

class MyController < ActionController::Base
  acts_as_mobile_controller

  def index
    puts "rendering mobile" if mobile?
    puts "rendering ipad" if ipad?

    respond_to do |format|
      format.html
      format.mobile
    end
  end
end

View

<html>
<body>
  <div><%= "Rendered from iPad" if ipad? %></div>
</body>
</html>

Copyright

Copyright © 2010 Eric Saxby. See LICENSE for details.

Something went wrong with that request. Please try again.