<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Slash Dot Dash: iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2</title>
    <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Rolling on Rails</description>
    <item>
      <title>iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2</title>
      <description>&lt;p style="float:right"&gt;&lt;a href="http://www.slashdotdash.net/images/iPhone3.gif"&gt;&lt;img src="http://www.slashdotdash.net/images/iPhone3p.gif" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p style="float:right"&gt;&lt;a href="http://www.slashdotdash.net/images/iPhone2.gif"&gt;&lt;img src="http://www.slashdotdash.net/images/iPhone2p.gif" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.slashdotdash.net/articles/2007/12/03/rails-2-upgrade-notes"&gt;After upgrading trawlr.com to Rails 2&lt;/a&gt; I thought I&amp;#8217;d make use of some of the new features and attempt to create an iPhone version of the site. 
With Rails 2 you can create a mime type specifically for the iPhone and then use that format in a &lt;code&gt;respond_to&lt;/code&gt; block (along with views such as &lt;code&gt;index.iphone.erb&lt;/code&gt;).&lt;/p&gt;


	&lt;h2&gt;Before you start &amp;#8211; iPhoney&lt;/h2&gt;


	&lt;p&gt;&lt;a href="http://www.marketcircle.com/iphoney/"&gt;iPhoney&lt;/a&gt; is an indispensable Mac-only tool for aiding the development of an iPhone specific site.&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Looking for a way to see how your web creations will look on iPhone? Look no further. iPhoney gives you a pixel-accurate web browsing environment&#8212;powered by Safari&#8212;that you can use when developing web sites for iPhone. It&amp;#8217;s the perfect 320 by 480-pixel canvas for your iPhone development. And it&amp;#8217;s free. iPhoney is not an iPhone simulator but instead is designed for web developers who want to create 320 by 480 (or 480 by 320) websites for use with iPhone. It gives you a canvas on which to test the visual quality of your designs.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Ensure iPhoney&amp;#8217;s user agent is set to &lt;code&gt;iPhone User Agent&lt;/code&gt; in the menu.&lt;/p&gt;


	&lt;h2&gt;iPhone mime type&lt;/h2&gt;


	&lt;p&gt;Create an iPhone mime type alias using Rails 2 &lt;code&gt;initializers&lt;/code&gt;.&lt;/p&gt;


&lt;code&gt;config/initializers/mime_types&lt;/code&gt;
&lt;pre&gt;
Mime::Type.register_alias "text/html", :iphone
&lt;/pre&gt;

	&lt;h2&gt;Detecting iPhone user agents&lt;/h2&gt;


	&lt;p style="float:right"&gt;&lt;a href="http://www.slashdotdash.net/images/iPhone1.gif"&gt;&lt;img src="http://www.slashdotdash.net/images/iPhone1p.gif" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Apple recommends that rather than redirecting iPhone users to an iPhone-optimised version of your site you should instead show the original site with a link to the alternative.&lt;/p&gt;


	&lt;p&gt;This can be achieved via user agent sniffing; looking for &lt;code&gt;Mobile Safari&lt;/code&gt; (as Apple suggests), rather that iPhone or iPod touch, to allow for future device support.&lt;/p&gt;


	&lt;p&gt;Adding a helper method to &lt;code&gt;application_helper.rb&lt;/code&gt; allows a notification message to be shown for &lt;em&gt;only&lt;/em&gt; iPhone users (try accessing &lt;a href="http://www.trawlr.com"&gt;www.trawlr.com&lt;/a&gt; from an iPhone).&lt;/p&gt;


&lt;code&gt;app/helpers/application_helper.rb&lt;/code&gt;
&lt;pre&gt;
# Request from an iPhone or iPod touch? (Mobile Safari user agent)
def iphone_user_agent?
  request.env["HTTP_USER_AGENT"] &amp;#38;&amp;#38; request.env["HTTP_USER_AGENT"][/(Mobile\/.+Safari)/]
end
&lt;/pre&gt;

	&lt;p&gt;In your view, show a message for iPhone user agents directing them to the iPhone version.&lt;/p&gt;


&lt;pre&gt;
&amp;lt;% if iphone_user_agent? # Show message for iPhone users -%&amp;gt;
&amp;lt;div class="message"&amp;gt;
    &amp;lt;p&amp;gt;Using an iPhone? &amp;lt;a href="http://iphone.trawlr.com/"&amp;gt;Use the optimised version&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;% end -%&amp;gt;
&lt;/pre&gt;

	&lt;h2&gt;iPhone subdomain&lt;/h2&gt;


	&lt;p&gt;Instead of forcing users straight to our iPhone version, we offer them the option by using a separate subdomain (&lt;a href="http://iphone.trawlr.com"&gt;iphone.trawlr.com&lt;/a&gt;) with a link back to the &lt;em&gt;regular&lt;/em&gt; site if they wish. When developing locally I modified my &lt;code&gt;/etc/hosts&lt;/code&gt; file as follows so that I could use http://iphone.localhost.com:3000/.&lt;/p&gt;


&lt;code&gt;/etc/hosts&lt;/code&gt;
&lt;pre&gt;
127.0.0.1 iphone.localhost.com
&lt;/pre&gt;

	&lt;p&gt;You may need to flush the &lt;span class="caps"&gt;DNS&lt;/span&gt; cache after making the changes.&lt;/p&gt;


&lt;pre&gt;
sudo dscacheutil -flushcache
&lt;/pre&gt;

	&lt;h2&gt;Adjust format for iPhone&lt;/h2&gt;


	&lt;p&gt;I chose to require login for all requests to the iPhone version of the site.&lt;/p&gt;


&lt;pre&gt;
class ApplicationController &amp;lt; ActionController::Base
    before_filter :adjust_format_for_iphone
    before_filter :iphone_login_required

private

  # Set iPhone format if request to iphone.trawlr.com
  def adjust_format_for_iphone    
    request.format = :iphone if iphone_request?
  end

  # Force all iPhone users to login
  def iphone_login_required
    if iphone_request?
      redirect_to login_path unless logged_in?
    end
  end

  # Return true for requests to iphone.trawlr.com
  def iphone_request?
    return (request.subdomains.first == "iphone" || params[:format] == "iphone")
  end
end
&lt;/pre&gt;

	&lt;p&gt;Note that &lt;code&gt;sessions_controller.rb&lt;/code&gt; (handles login) requires &lt;code&gt;skip_before_filter :iphone_login_required&lt;/code&gt;.&lt;/p&gt;


	&lt;h2&gt;Using iUI and creating iPhone views&lt;/h2&gt;


	&lt;p&gt;The &lt;a href="http://code.google.com/p/iui/"&gt;iUI&lt;/a&gt; framework, based on Joe Hewitt&amp;#8217;s iPhone navigation work, hugely simplifies iPhone web development. All you need to do is include the iUI JavaScript and &lt;span class="caps"&gt;CSS&lt;/span&gt; files along with included images and create your views in a particular structure to have native iPhone behaviour such as sliding menus and &lt;span class="caps"&gt;AJAX&lt;/span&gt; page loading.&lt;/p&gt;


	&lt;p&gt;Rails 2 makes it trivial to create different views depending upon the format, including layouts. Our iPhone layout includes a few specifics for iUI and a &lt;code&gt;viewport&lt;/code&gt; meta tag for the device.&lt;/p&gt;


&lt;code&gt;app/views/layouts/application.iphone.erb&lt;/code&gt;
&lt;pre&gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&amp;gt;
    &amp;lt;meta id="viewport" name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;%= @page_title -%&amp;gt;&amp;lt;/title&amp;gt;
  &amp;lt;%= stylesheet_link_tag 'iui' %&amp;gt;
  &amp;lt;%= javascript_include_tag 'iui' %&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class="toolbar"&amp;gt;
        &amp;lt;h1 id="pageTitle"&amp;gt;&amp;lt;/h1&amp;gt;
        &amp;lt;a id="backButton" class="button" href="#"&amp;gt;&amp;lt;/a&amp;gt;
    &amp;lt;/div&amp;gt;

    &amp;lt;%= yield %&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

	&lt;p&gt;When creating your iPhone views you should follow the iUI style guide, an example page is given below. Standard hyperlinks are loaded using &lt;span class="caps"&gt;AJAX&lt;/span&gt; and &lt;em&gt;slide&lt;/em&gt; into view, navigating back is handled by iUI. Links may be prefixed with &lt;code&gt;target="_self"&lt;/code&gt; to replace the entire page or &lt;code&gt;target="_replace"&lt;/code&gt; to replace the element with the response (using &lt;span class="caps"&gt;AJAX&lt;/span&gt;).&lt;/p&gt;


&lt;code&gt;index.iphone.erb&lt;/code&gt;
&lt;pre&gt;
&amp;lt;ul title="Home" selected="true"&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;%= link_to 'Example action', example_path %&amp;gt;&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;%= link_to 'Logout', logout_path, :method =&amp;gt; :delete, :target =&amp;gt; '_self' %&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/pre&gt;

&lt;code&gt;show.iphone.erb&lt;/code&gt;
&lt;pre&gt;
&amp;lt;div class="panel" title="Example" selected="true"&amp;gt;
    &amp;lt;h2&amp;gt;Example Content&amp;lt;/h2&amp;gt;
    &amp;lt;p&amp;gt;Here's some content&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;

	&lt;p&gt;It&amp;#8217;s important to remember that iUI will load content using &lt;span class="caps"&gt;AJAX&lt;/span&gt;, thus you &lt;strong&gt;only&lt;/strong&gt; need to render a layout (such as &lt;code&gt;application.iphone.erb&lt;/code&gt;) for the first request or page of your iPhone site. All following requests should use &lt;code&gt;render :layout =&amp;gt; false&lt;/code&gt; (unless loaded into a new page with &lt;code&gt;target="_replace"&lt;/code&gt;). If you experience any wierd rendering issues it&amp;#8217;ll most likely be due to this irregularity.&lt;/p&gt;


&lt;pre&gt;
respond_to do |format|
    format.iphone do  # action.iphone.erb
      render :layout =&amp;gt; false
    end
end
&lt;/pre&gt;

	&lt;h2&gt;Show, don&amp;#8217;t tell&lt;/h2&gt;


	&lt;p&gt;Why not try &lt;a href="http://iphone.trawlr.com/"&gt;iphone.trawlr.com&lt;/a&gt; for yourself? It&amp;#8217;ll work for your iPhone or any web browser. You&amp;#8217;ll need to register via the &lt;a href="http://www.trawlr.com/"&gt;normal site&lt;/a&gt; if you don&amp;#8217;t already have an account (quick, no email registration required)!&lt;/p&gt;


	&lt;h2&gt;References&lt;/h2&gt;


	&lt;p&gt;The following resources on the new Rails 2 iPhone format ability and iUI library were extremely helpful; the documentation from Apple not so much!&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;http://developer.apple.com/iphone/&lt;/li&gt;
		&lt;li&gt;http://www.railspikes.com/2007/11/8/iphone-subdomains-with-rails&lt;/li&gt;
		&lt;li&gt;http://blog.nicksieger.com/articles/2007/09/18/railsconf-europe-david-heinemeier-hansson&lt;/li&gt;
		&lt;li&gt;http://www.joehewitt.com/blog/introducing_iui.php&lt;/li&gt;
		&lt;li&gt;http://code.google.com/p/iui/&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Yes, I&amp;#8217;m still loving the iPhone!&lt;/p&gt;</description>
      <pubDate>Tue, 04 Dec 2007 00:33:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:f392cffa-af1c-44ce-b0d3-4174a232a3ff</guid>
      <author>ben@slashdotdash.net (Ben)</author>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2</link>
      <category>Ruby on Rails</category>
      <category>iPhone</category>
      <category>iPhone</category>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by joost</title>
      <description>&lt;p&gt;Rather than &lt;code&gt;request.env["HTTP_USER_AGENT"] &amp;#38;&amp;#38; request.env["HTTP_USER_AGENT"][/(Mobile\/.+Safari)/]&lt;/code&gt; I would use / am using &lt;code&gt;request.user_agent =~ /(Mobile\/.+Safari)/&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;Less is more :)&lt;/p&gt;</description>
      <pubDate>Sun, 29 Jun 2008 20:00:28 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:9ae1fc90-9dd8-4b84-b09f-a6b846db37bd</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-468</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by danbucks</title>
      <description>&lt;p&gt;On this example, and Apple&amp;#8217;s example, the setting of the format is flawed:
iphone_request? should check the current fundamental format, and, typically, only change the format if the incoming format is text/html.
Alternatively, the programmer needs to really know what they are doing if they alias all incoming formats &amp;#8211; no matter what they may be (javascript is a common case) &amp;#8211; onto :iphone&lt;/p&gt;</description>
      <pubDate>Tue, 17 Jun 2008 21:06:45 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:bb54eec9-fd59-41ca-8a54-7ec38cf938c4</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-464</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by nameth</title>
      <description>&lt;p&gt;very nice&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Thu, 10 Apr 2008 16:46:52 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:12d55595-39be-40e3-b1f3-10cb1e155ebd</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-424</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by dave@thoughtbureau.com</title>
      <description>&lt;p&gt;does anyone know where to obtain iPhone UI specs?&lt;/p&gt;


	&lt;p&gt;Thank you&lt;/p&gt;</description>
      <pubDate>Wed, 02 Apr 2008 21:13:46 +0100</pubDate>
      <guid isPermaLink="false">urn:uuid:d44e84b7-9192-46d1-afb1-e823ada89b7b</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-416</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by Tiffani</title>
      <description>&lt;p&gt;Hey, Ben.  This is awesome.  But, did you encounter an funny business with Rails picking up application.iphone.erb?  I&amp;#8217;m on Rails 2.0.2 and for some reason, even though everything appears to be set up properly, my iPhone requests don&amp;#8217;t at all flow through application.iphone.erb.  Any ideas why this might be?  TIA!&lt;/p&gt;</description>
      <pubDate>Sun, 02 Mar 2008 01:02:29 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:9d04ca2a-1750-4446-bc05-b727a9ecb1a6</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-385</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by Chris</title>
      <description>&lt;p&gt;Nice, Ben.  Your approach is a bit different than mine in that I&amp;#8217;m not using a separate subdomain (despite Apple&amp;#8217;s wish that we all bow down to their creation).  But a problem I am having I think you would have as well: how do you ensure that javascript requests, json requests, xml requests and CSS requests don&amp;#8217;t get funnelled into the :iphone format?  The only solution I have found is to change the format to :iphone only when the format is already html.  So, something like this:&lt;/p&gt;


	&lt;p&gt;request.format = :iphone if (browser_is_iphone? &amp;#38;&amp;#38; request.format.html?)&lt;/p&gt;


	&lt;p&gt;How do you ensure that iphone requests for javascript/json/etc. don&amp;#8217;t get munged into iphone html?&lt;/p&gt;


	&lt;p&gt;-Chris&lt;/p&gt;</description>
      <pubDate>Mon, 21 Jan 2008 21:29:24 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:feed86fc-2d36-4d48-b1a7-9b59ee53a736</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-359</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by screwphone</title>
      <description>&lt;p&gt;many thanks!  helped out a ton with our iphone-only site.&lt;/p&gt;</description>
      <pubDate>Wed, 09 Jan 2008 01:02:39 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ac393d62-0515-4697-908f-e3c87a09ad0d</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-338</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by Vendy</title>
      <description>&lt;p&gt;Wow thanks! I&#8217;m a regular reader and enjoy your work. Keep it up!&lt;/p&gt;</description>
      <pubDate>Thu, 27 Dec 2007 17:52:18 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:2c2ed695-9c66-4eae-b1e0-886e3ccf404b</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-328</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by boyinapalli@hotmail.com</title>
      <description>&lt;p&gt;Thanks i worked out the problem.  I had to change the javascript.&lt;/p&gt;</description>
      <pubDate>Thu, 20 Dec 2007 13:22:34 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:185bf03a-9751-4981-8d09-17f47d639354</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-314</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by Ben</title>
      <description>&lt;p&gt;I think you need to add &lt;code&gt;target="_self"&lt;/code&gt; to any external links&amp;#8230;.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;&amp;lt;a target="_self" href="http://info.aol.co.uk/email"&amp;gt;AOL&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 17 Dec 2007 13:31:31 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:64e46f0b-3091-4954-a84c-47905d27746d</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-311</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by boyinapalli@hotmail.com</title>
      <description>&lt;p&gt;Dear Friend,&lt;/p&gt;


	&lt;p&gt;I am designing a wowlinks page for my iphone here is the link:   &lt;a href="http://www.wowlinks.co.uk/m" rel="nofollow"&gt;http://www.wowlinks.co.uk/m&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;The problem is, i am unable to make the hyperlinks work.  Can you help me?&lt;/p&gt;


	&lt;p&gt;Thanks
Bhagavan&lt;/p&gt;</description>
      <pubDate>Mon, 17 Dec 2007 13:20:39 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0f924f5c-2e00-4635-8d9b-e7d3d50871cf</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-310</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by http://mobilezoo.biz</title>
      <description>&lt;p&gt;Hi,&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m new to rails :)&lt;/p&gt;


	&lt;p&gt;Sorry for asking the question, but where to put the Code snippet respond_to ? I currently get a 406 http response code when pointing my iphone to my site.&lt;/p&gt;


	&lt;p&gt;Thank you in advance,
iSdl&lt;/p&gt;</description>
      <pubDate>Fri, 14 Dec 2007 13:05:47 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:c7537378-17ac-4a9e-8daa-c8aebabde9b8</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-307</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by Fr&#233;d&#233;ric de Villamil</title>
      <description>&lt;p&gt;Hey, nice shoot. Shall be in Typo 5.0 if I have the time (hint : release soon).&lt;/p&gt;</description>
      <pubDate>Thu, 13 Dec 2007 15:15:26 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:df67ff2a-418b-4883-bf1d-399f2fb31c6e</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-303</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by bbebop</title>
      <description>&lt;p&gt;Thanks for these tips on using iUI! I&amp;#8217;m creating an iPhone version of an existing app that uses ajax for sorting lists, drag and drop between lists, etc. I&amp;#8217;d like to retain that functionality (it mostly seems to work), but not sure how to do in the context of iUI&amp;#8217;s use of ajax. Any suggestions?&lt;/p&gt;</description>
      <pubDate>Mon, 10 Dec 2007 07:53:18 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:10b8440d-18f2-4f5a-8727-0376dfbed198</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-298</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by Gustavo Barron</title>
      <description>&lt;p&gt;Nice tips actually now that I just buy a iPod touch I was wondering about making some nice apps to administer some tasks and your tips will boost my speed on doing them&lt;/p&gt;


	&lt;p&gt;Kudos!!!&lt;/p&gt;</description>
      <pubDate>Fri, 07 Dec 2007 09:06:56 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:943219ed-c932-417c-a157-209cb0bc7db2</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-293</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by Ben</title>
      <description>&lt;p&gt;Matt: The &lt;code&gt;adjust_format_for_iphone&lt;/code&gt; before filter does the routing; the main site (&lt;a href="http://www.trawlr.com" rel="nofollow"&gt;www.trawlr.com&lt;/a&gt;) and iPhone subdomain (&lt;a href="http://iphone.trawlr.com" rel="nofollow"&gt;iphone.trawlr.com&lt;/a&gt;) both point to the same Rails app.&lt;/p&gt;</description>
      <pubDate>Thu, 06 Dec 2007 11:31:51 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:984c660d-a4cd-4f9d-99ff-f7cd725a280e</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-292</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by Matt K</title>
      <description>&lt;p&gt;Great tips!  Would you mind posting the routing you used to separate the subdomain (iphone.trawlr.com) from the main domain, or did you build a separate webapp hosted at the subdomain?&lt;/p&gt;</description>
      <pubDate>Thu, 06 Dec 2007 04:30:25 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:03eb4702-6ccd-42d9-a18e-d93ccc2081d6</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-290</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by topfunky</title>
      <description>&lt;p&gt;For sites that can&amp;#8217;t be easily re-templated (or don&amp;#8217;t need to be), I&amp;#8217;ve had success with wrapping a global iPhone layout and custom CSS around my existing HTML templates.&lt;/p&gt;


&lt;pre&gt;
layout :determine_layout

def determine_layout
  if mobile_safari_subdomain_or_relevant_header?
    return "iphone" 
  end

  return "application" 
end
&lt;/pre&gt;

	&lt;p&gt;You can make the entire site iPhone-friendly in a few minutes and you don&amp;#8217;t have to rewrite every template to do it.&lt;/p&gt;</description>
      <pubDate>Tue, 04 Dec 2007 19:43:21 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:6163754c-ed79-4892-8741-ed84a0c42a39</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-278</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by Chris</title>
      <description>&lt;p&gt;Great article.  Thanks for taking the time to school us on this one! :D&lt;/p&gt;</description>
      <pubDate>Tue, 04 Dec 2007 19:19:21 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:c5ddbb4d-967a-46b7-9198-8edfc7a501e0</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-277</link>
    </item>
    <item>
      <title>"iPhone on Rails - Creating an iPhone optimised version of your Rails site using iUI and Rails 2" by Luke Francl</title>
      <description>&lt;p&gt;Nice article on iPhone development and thanks for linking to &lt;a href="http://www.railspikes.com/2007/11/8/iphone-subdomains-with-rails" rel="nofollow"&gt;my post&lt;/a&gt; about it.&lt;/p&gt;


	&lt;p&gt;I like the virtual iphone subdomain trick you&amp;#8217;re using&amp;#8230;I think I will switch to that rather than sniffing the user agent while testing. I&amp;#8217;m also going to check out iUi, that looks very cool.&lt;/p&gt;</description>
      <pubDate>Tue, 04 Dec 2007 02:41:32 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:aa2426eb-55ad-4614-886c-b6b924b88931</guid>
      <link>http://www.slashdotdash.net/articles/2007/12/04/iphone-on-rails-creating-an-iphone-optimised-version-of-your-rails-site-using-iui-and-rails-2#comment-267</link>
    </item>
  </channel>
</rss>
