<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;This is a very basic example.&lt;/p&gt;
&lt;p&gt;Create a controller for testing:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code&gt;
./script/generate controller welcome
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
Controller code (welcome_controller.rb):&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code&gt;
class WelcomeController &amp;lt; ApplicationController
  acts_as_iphone_controller :test_mode =&amp;gt; true&lt;/p&gt;
class ListItem
def initialize( num )
@num = num
end

def caption
&amp;#8220;Item #{@num.to_s}&amp;#8221;
end

def url
&amp;#8220;/welcome/#{@num.to_s}&amp;#8221;
end
end
def index
@list = Array.new
for i in 1..5 do
@list.push( ListItem.new( i ) )
end
respond_to do |format|
format.html      # use index.erb
format.iphone    # use index.iphone.erb
end
end
&lt;p&gt;end&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;View code (index.iphone.erb):&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
&lt;code&gt;
&amp;lt;%=
  l = { :caption =&amp;gt; 'Home', :url =&amp;gt; &quot;/welcome&quot;, :html_options =&amp;gt; {} }
  r = { :back =&amp;gt; true, :caption =&amp;gt; 'Back', :url =&amp;gt; &quot;/&quot;, :html_options =&amp;gt; {} }
  te_navigation_bar( r, &quot;Test.app&quot;, l )
%&amp;gt;
&amp;lt;%= te_list @list %&amp;gt;
&lt;/code&gt;&lt;br /&gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This should produce a single screen with a toolbar at the top and a list beneath it.&lt;/p&gt;</body>
  <created-at type="datetime">2009-11-25T21:19:51-08:00</created-at>
  <id type="integer">93580</id>
  <permalink>very-basic-example</permalink>
  <repository-id type="integer">54422</repository-id>
  <title>Very Basic Example</title>
  <updated-at type="datetime">2008-12-09T18:54:55-08:00</updated-at>
  <user-id type="integer">25813</user-id>
</wiki>
