<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - rails 2.0 - Comments</title>
 <link>http://community.activestate.com/tags/rails-2-0</link>
 <description>Comments for &quot;rails 2.0&quot;</description>
 <language>en</language>
<item>
 <title>Answering the question about listing attributes (finally)</title>
 <link>http://community.activestate.com/working-rails-2-0-scaffolds-komodo#comment-4252</link>
 <description>&lt;p&gt;You don&#039;t have to list all the attributes in the scaffold command.&lt;br /&gt;
The scaffold command will auto-generate the created_on and updated_on&lt;br /&gt;
timestamp fields for you automatically.  You can bypass that by&lt;br /&gt;
running the command from the command-line, like so:&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;ruby script/generate scaffold --skip-timestamps ModelName attr:type ...&lt;/pre&gt;&lt;p&gt;
Later on you would use the &lt;code class=&quot;geshifilter&quot;&gt;generate/migration&lt;/code&gt; and&lt;br /&gt;
&lt;code class=&quot;geshifilter&quot;&gt;migrate/db:migrate&lt;/code&gt; commands to add more attributes,&lt;br /&gt;
just like in 1.x.&lt;/p&gt;
</description>
 <pubDate>Wed, 20 Feb 2008 22:05:30 +0000</pubDate>
 <dc:creator>ericp</dc:creator>
 <guid isPermaLink="false">comment 4252 at http://community.activestate.com</guid>
</item>
<item>
 <title>You should be able to add new attributes incrementally</title>
 <link>http://community.activestate.com/working-rails-2-0-scaffolds-komodo#comment-4075</link>
 <description>&lt;p&gt;You&#039;ll have to manually update the views, but scaffold-generated&lt;br /&gt;
views have always been intended to be just scaffolding, and not&lt;br /&gt;
the final product.&lt;/p&gt;
&lt;p&gt;As I showed above, I find the controllers that the new&lt;br /&gt;
scaffolder generates to be pretty cool.&lt;/p&gt;
</description>
 <pubDate>Tue, 05 Feb 2008 18:31:42 +0000</pubDate>
 <dc:creator>ericp</dc:creator>
 <guid isPermaLink="false">comment 4075 at http://community.activestate.com</guid>
</item>
<item>
 <title>Scaffolding changed with Rails 2.0 </title>
 <link>http://community.activestate.com/working-rails-2-0-scaffolds-komodo#comment-4074</link>
 <description>&lt;p&gt;The changes are not backward-compatible, unfortunately.&lt;br /&gt;
I couldn&#039;t resist showing some of the benefits of&lt;br /&gt;
the new version, while showing how to get going...&lt;/p&gt;
&lt;p&gt;The new site for the scaffold-resource-generated app is:&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;http://localhost:3000/movies/&lt;/pre&gt;&lt;p&gt;
Because the scaffold generator is now restful it gives you&lt;br /&gt;
the following URIs:&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;http://localhost:3000/movies/ ==&amp;gt; index

&lt;a href=&quot;http://localhost:3000/movies/3&quot; title=&quot;http://localhost:3000/movies/3&quot;&gt;http://localhost:3000/movies/3&lt;/a&gt; ==&amp;gt; display item 3

&lt;a href=&quot;http://localhost:3000/movies/4/edit&quot; title=&quot;http://localhost:3000/movies/4/edit&quot;&gt;http://localhost:3000/movies/4/edit&lt;/a&gt; ==&amp;gt; edit page for item 4

&lt;a href=&quot;http://localhost:3000/movies/new&quot; title=&quot;http://localhost:3000/movies/new&quot;&gt;http://localhost:3000/movies/new&lt;/a&gt; ==&amp;gt; display new-movie page&lt;/pre&gt;&lt;p&gt;
And you can add a &quot;.xml&quot; to the end of the URL:&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;http://localhost:3000/movies/2.xml ==&amp;gt; return an XML view of item 2&lt;/pre&gt;&lt;p&gt;
Now add this line to the show method in movies_controller.rb,&lt;br /&gt;
under the format.xml line:&lt;/p&gt;
&lt;div class=&quot;geshi-block&quot;&gt;
&lt;div class=&quot;geshifilter ruby&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color:#CC0066; font-weight:bold;&quot;&gt;format&lt;/span&gt;.&lt;span style=&quot;color:#9900CC;&quot;&gt;js&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#123;&lt;/span&gt; render &lt;span style=&quot;color:#ff3333; font-weight:bold;&quot;&gt;:json&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color:#0066ff; font-weight:bold;&quot;&gt;@movie&lt;/span&gt; &lt;span style=&quot;color:#006600; font-weight:bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;geshi-plain&quot;&gt;format.js { render :json =&amp;gt; @movie }&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here&#039;s what the JSON Rails returns would look like.&lt;/p&gt;
&lt;pre class=&quot;geshifilter&quot;&gt;$ wget -q  -O - &lt;a href=&quot;http://localhost:3000/movies/2.js&quot; title=&quot;http://localhost:3000/movies/2.js&quot;&gt;http://localhost:3000/movies/2.js&lt;/a&gt;
{&quot;updated_at&quot;: &quot;2008/02/05 10:15:21 -0800&quot;,
 &quot;title&quot;: &quot;elf&quot;,
 &quot;id&quot;: 2,
 &quot;year&quot;: 2002, &quot;created_at&quot;: &quot;2008/02/05 10:15:21 -0800&quot;}
$&lt;/pre&gt;&lt;p&gt;
Hope this gets you going.  I plan on updating the toolset and&lt;br /&gt;
screencast to work with Rails 2 soon now.&lt;/p&gt;
</description>
 <pubDate>Tue, 05 Feb 2008 18:25:42 +0000</pubDate>
 <dc:creator>ericp</dc:creator>
 <guid isPermaLink="false">comment 4074 at http://community.activestate.com</guid>
</item>
<item>
 <title>How many Attributes do you have to list?</title>
 <link>http://community.activestate.com/working-rails-2-0-scaffolds-komodo#comment-4073</link>
 <description>&lt;p&gt;Do you have to list all attributes of the model, or does this let you create a scaffold selectively?  Also, what is the address for the scaffold once it&#039;s created?  According to the tutorial, it should be &lt;a href=&quot;http://localhost:3000/library&quot; title=&quot;http://localhost:3000/library&quot;&gt;http://localhost:3000/library&lt;/a&gt;, but clearly it&#039;s not going to get the library name now.&lt;br /&gt;
:Nate Dickson&lt;/p&gt;
</description>
 <pubDate>Tue, 05 Feb 2008 17:53:16 +0000</pubDate>
 <dc:creator>PogiNate</dc:creator>
 <guid isPermaLink="false">comment 4073 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
