No commit activity in last 3 years
No release in over 3 years
A gem to easily add mobile support to your Rails app!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0

Runtime

~> 3.0
~> 0.14.4
 Project Readme

A gem to easily add mobile support to your Rails app!

To install

gem install jquery-mobile-rails

or in Gemfile

gem 'jquery-mobile-rails'

Usage

You will have access to a mobile? method in your controllers and layouts that will be true when a mobile devise visits the app. In your controller, add:

<% if mobile? %>
<%= stylesheet_link_tag "http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" %><%= javascript_include_tag "http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js" %>
<% end %>

Note, you want to have your custom JS code included before the jQueryMobile JS file, so that it can fire the mobileinit hooks you set up (see http://jquerymobile.com/demos/1.0a2/#docs/api/globalconfig.html)