Give 'em what they want. Pretty complicated strategy, huh?

Rails Plug-in for the iPhone

This plug-in is the result of some recent web development for iPhone and Mobile based applications using the iUI toolkit, which contains a number of CSS styles and JavaScript event handlers to make iPhone Web apps look and feel somewhat like native iPhone applications.

Download the plug-in from github

Currently, the plug-in is primarily focused on the following:

  • A rake task to download iUI
  • Moving files to the Rails public directories
  • Changing the CSS image URL’s accordingly

There’s a controller class method acts_as_iphone_controller, calling that sets up a before filter that captures the Mobile Safari user agent string and sets the request format to iphone for use in respond_to blocks. For testing purposes you can call the method as acts_as_iphone_controller(true), and all calls will be treated as iPhone requests.

There is a module of helper methods that are wrapper methods or combinations of iUI CSS classes.

Included are:

  • A method for creating the iPhone toolbar at the top of the view
  • Methods for creating the iPhone list structures from a list of elements that know their associated URLs, including a grouped list in the style of the iPod application
  • Rounded rectangle classes
  • A form helper for the iPhone toggle button, as seen in the settings page
  • A method to specify an Ajax callback when the phone changes orientation

Download the plug-in from github

The short term goals for the project are to tighten the code a bit and improve documentation and testing. Longer term goals are to augment iUI’s JavaScript handlers with something a bit friendlier with Rails, particularly in handling history and back behavior.

Want more information?

Check out Pathfinder’s Ruby on Rails page

Get Noel Rappin’s latest book ‘Professional Ruby on Rails’

Read Pathfinder’s Agile Ajax blog

Learn more about Pathfinder’s other Open Source projects

Need help?

Pathfinder specializes in building Rails applications and user experience design. We provide consulting and training services to help you build mobile and web based applications that are easy to use and meet your business goals.

Give us a call at 866.882.7215 or contact us to discuss your specific situation and how we can help you.

Stay connected.

Receive the latest updates on user experience design and Agile development best practices.

Sign-up for Pathfinder’s newsletter

Books we have written.

  • Professional Ruby on Rails

    by Noel Rappin Director, Pathfinder Development Ruby on Rails Practice

    This book bridges the gap between what you’ll learn from a typical beginner book and what you’ll need to know to create a solid, professional, spectacular web application.

  • Real World Ajax: Secrets of the Masters

    contributions by Dietrich Kappe Chief Technology Officer, Pathfinder Development

    Aimed at everyone from enterprise developers to self-taught scripters, Real-World AJAX: Secrets of the Masters is the perfect book for anyone who wants to start understanding the basics of AJAX.

  • more information
Comments about this site: info@pathf.com