<?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>{ height: 1%; } - Ruby on Rails and User Interface Design: Ajax Scaffold Plugin Released</title>
    <link>http://www.height1percent.com/articles/2006/09/12/ajax-scaffold-plugin-released</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>CSS, UI Design, Ruby on Rails and cheese ... lots of cheese</description>
    <item>
      <title>Ajax Scaffold Plugin Released</title>
      <description>&lt;p&gt;&lt;span style="background-color: #ff8; font-weight: bold; padding: 2px 5px;"&gt;AjaxScaffold has been deprecated in favor of &lt;a href="http://activescaffold.com"&gt;ActiveScaffold&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;


&lt;blockquote&gt;Ajax Scaffold is nice, but generated code just doesn&amp;#8217;t scale well. There&amp;#8217;s too much effort required to make cross cutting changes.&lt;/blockquote&gt;

&lt;blockquote&gt;I really like Ajax Scaffold but it&amp;#8217;s really hard to upgrade when a new version comes out. I usually spend a couple hours diffing all my scaffolds with a newly generated one.&lt;/blockquote&gt;

	&lt;p&gt;I couldn&amp;#8217;t agree more and we now have an answer to those problems: an &lt;a href="http://www.ajaxscaffold.com"&gt;Ajax Scaffold&lt;/a&gt; plugin. Creating a scaffold is now as easy as:&lt;/p&gt;


&lt;pre&gt;class WidgetController &amp;lt; ApplicationController

  ajax_scaffold :widget

end&lt;/pre&gt;

	&lt;p&gt;Need extra control over the displayed data?&lt;/p&gt;


&lt;pre&gt;class WidgetController &amp;lt; ApplicationController

  ajax_scaffold :widget

  @@scaffold_columns = [
    AjaxScaffold::ScaffoldColumn.new(Task, {:name =&amp;gt; "name", 
         :sort =&amp;gt; "name.downcase" }),
    AjaxScaffold::ScaffoldColumn.new(Task, {:name =&amp;gt; "tags", 
         :eval =&amp;gt; "widget.tag_names.collect{|t|h(t)}.join(', ')" })
  ]

end&lt;/pre&gt;

	&lt;p&gt;And it can scale up to be just as customizable as the generated code. Need to customize the form partial? Just copy _form.rhtml into your controller&amp;#8217;s view directory and change it. &lt;strong&gt;If you&amp;#8217;re new to Ajax Scaffold you will probably want to play around with a generated scaffold first&lt;/strong&gt; to get a feel for how all the pieces (controllers, views, etc) fit together as the plugin code is a bit more complex (but should make sense if you&amp;#8217;ve used the Ajax Scaffold generator).&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;The plugin is almost a direct port of the functionality of the existing Ajax Scaffold generator&lt;/strong&gt; with a few extra conveniences tacked on (total rows, sorting by method, etc). One major difference is that the &lt;strong&gt;scaffold_columns definitions have been moved from the model to the controller&lt;/strong&gt; (The generator will be going this way in it&amp;#8217;s next release).&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;We will be versioning the two projects in parallel&lt;/strong&gt; to keep confusion to a minimum. The plugin release is 3.2.0 which will be the same version as the next generator release that incorporates some of the changes the plugin has made (scaffold_columns in the controller).&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Many thanks go to &lt;a href="http://blog.caronsoftware.com/"&gt;Scott Rutherford&lt;/a&gt;&lt;/strong&gt; for writing the bulk of the code as well as the howto guides (which you can get to via the &lt;a href="http://ajaxscaffold.stikipad.com/"&gt;Ajax Scaffold wiki&lt;/a&gt;). &lt;a href="http://blog.caronsoftware.com/articles/2006/09/02/getting-started-with-the-ajax-scaffold-plugin"&gt;Ready to get started?&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 12 Sep 2006 21:09:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:421706f2-ab6f-4afa-b6be-725255c2efbf</guid>
      <author>Richard White</author>
      <link>http://www.height1percent.com/articles/2006/09/12/ajax-scaffold-plugin-released</link>
      <category>ajaxscaffold</category>
      <trackback:ping>http://www.height1percent.com/articles/trackback/951</trackback:ping>
    </item>
    <item>
      <title>"Ajax Scaffold Plugin Released" by Richard White</title>
      <description>&lt;p&gt;@Pupeno: Associations are a sticky topic, but are also the number 1 thing on our list (besides fixing bugs). We won&amp;#8217;t get to autogeneration soon enough but we&amp;#8217;ll be ramping up in that direction by at least making adding relationships a bit easier. For now you just have to override _form.rhtml.
&lt;br /&gt;
You can sort a column either in SQL or in memory. You want to do the latter so just specify the :sort option in your ScaffoldColumn definition. If you had User.tasks, then you&amp;#8217;d want the value of :sort to be &amp;#8220;tasks&amp;#8221;&lt;/p&gt;</description>
      <pubDate>Thu, 28 Sep 2006 07:23:50 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:658e01ac-08bc-43a7-9983-5fba88e3a6e3</guid>
      <link>http://www.height1percent.com/articles/2006/09/12/ajax-scaffold-plugin-released#comment-986</link>
    </item>
    <item>
      <title>"Ajax Scaffold Plugin Released" by Pupeno</title>
      <description>&lt;p&gt;How do you do a custom pagination with the plug in (to be able to sort by relationships) ?&lt;/p&gt;</description>
      <pubDate>Mon, 25 Sep 2006 23:58:10 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ff1a5464-7262-4839-ab63-7d49cf545ee9</guid>
      <link>http://www.height1percent.com/articles/2006/09/12/ajax-scaffold-plugin-released#comment-975</link>
    </item>
    <item>
      <title>"Ajax Scaffold Plugin Released" by Pupeno</title>
      <description>&lt;p&gt;Excellent! The ajaxscaffold plug-in is excellent!
Is there some reason assosiations are not picked up automatically generating a select element in the form.
The options in the select would have the foreigns ids and if the content would be a problem, just getting the to_s of the object would be a good solution. Yes, I&amp;#8217;ll show a useless object pointer untill to_s is implemented, which is trivial.
Thanks and please keep with the good work!&lt;/p&gt;</description>
      <pubDate>Sat, 23 Sep 2006 23:52:09 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:8ffbf1a2-5069-43ca-a3f5-0dbb845028d8</guid>
      <link>http://www.height1percent.com/articles/2006/09/12/ajax-scaffold-plugin-released#comment-973</link>
    </item>
    <item>
      <title>"Ajax Scaffold Plugin Released" by Dr Nic</title>
      <description>&lt;p&gt;Yippee! Now we have magical scaffolding! Thanks Scott and Richard!&lt;/p&gt;


	&lt;p&gt;(Sorry for the excessive !&amp;#8217;s &amp;#8230; but they do help to express my joy :)&lt;/p&gt;</description>
      <pubDate>Wed, 13 Sep 2006 09:58:43 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:116e1665-b6b8-4b12-b14d-028c0c102f74</guid>
      <link>http://www.height1percent.com/articles/2006/09/12/ajax-scaffold-plugin-released#comment-953</link>
    </item>
  </channel>
</rss>
