<?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: AjaxScaffold lessons: Customizing the display columns and using scaffolds as components </title>
    <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>CSS, UI Design, Ruby on Rails and cheese ... lots of cheese</description>
    <item>
      <title>AjaxScaffold lessons: Customizing the display columns and using scaffolds as components </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;p&gt;I&amp;#8217;ve been promising a number of you articles about how to do various, and common, customizations of your Ajax scaffolds. Rather than try to cover all your questions in one voluminous post I&amp;#8217;ll try to tackle them a few at a time. &lt;/p&gt;

&lt;p&gt;This first one will be on two rather simple topics, how to customize the the scaffold columns and how to create an admin console from multiple scaffolds. From here on in I am assuming that you have a least read the &lt;a href="http://www.height1percent.com/articles/2006/02/21/on-the-new-ajax-scaffold-generator"&gt;introductory article&lt;/a&gt; and have generated a scaffold or two. Without further ado, lets begin.&lt;/p&gt;

&lt;h3&gt;Customizing the columns&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;There is a much easier way to do this, check out the &lt;a href="http://height1percent.com/articles/2006/04/12/ajaxscaffold-3-0-0-released"&gt;3.0.0 release notes&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Probably the first thing you want to change after you generate a scaffold are its columns. If you look in &lt;em&gt;_modelname.rhtml&lt;/em&gt; (ex: &lt;em&gt;_widget.rhtml&lt;/em&gt;) you&amp;#8217;ll find the code that writes out the model&amp;#8217;s attributes to the table:&lt;/p&gt;
&lt;pre&gt;
  &amp;amp;lt;% for column in Widget.content_columns %&amp;amp;gt;
    &amp;amp;lt;%=h widget.send(column.name) %&amp;amp;gt;
  &amp;amp;lt;% end %&amp;amp;gt;
&lt;/pre&gt;
&lt;p&gt;Using Widget.content_columns is good from the standpoint that it gets you up and running fast but obviously has a number of drawbacks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You often end up with a lot of backend attributes like created_at, updated_at and other attributes you probably only need for backend processing showing up.&lt;/li&gt;
&lt;li&gt;Except in the simplest of examples you will have associations (&lt;code&gt;belongs_to&lt;/code&gt;, &lt;code&gt;has_many&lt;/code&gt;, &lt;code&gt;has_and_belongs_to_many&lt;/code&gt;, etc) that aren&amp;#8217;t included.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no magic solution to this, just explicitly setting what columns you want to show up. We can replace the preceding code with the following:&lt;/p&gt;

&lt;pre&gt;
&amp;amp;lt;td&amp;amp;gt;&amp;amp;lt;%=h widget.name %&amp;amp;gt;&amp;amp;lt;/td&amp;amp;gt;
&amp;amp;lt;td&amp;amp;gt;&amp;amp;lt;%=h widget.version %&amp;amp;gt;&amp;amp;lt;/td&amp;amp;gt;
&amp;amp;lt;td&amp;amp;gt;&amp;amp;lt;%=h widget.owner.name %&amp;amp;gt;&amp;amp;lt;/td&amp;amp;gt;
&lt;/pre&gt;
&lt;p&gt;So now we&amp;#8217;ve specified that we want to display the name of the widget, its version and the name the owner object that is associated with it. This is assuming that we have mapped that association in our &lt;em&gt;widget.rb&lt;/em&gt; and there is a model named Owner:&lt;/p&gt;

&lt;pre&gt;
class Widget &amp;amp;lt; ActiveRecord::Base

  &amp;lt;strong&amp;gt;belongs_to :owner&amp;lt;/strong&amp;gt;

  validates_presence_of :name

end
&lt;/pre&gt;

&lt;p&gt;Now we need to also explicitly set our column headers in &lt;em&gt;list.rhtml&lt;/em&gt;:&lt;/p&gt;
&lt;pre&gt;
  &amp;amp;lt;thead&amp;amp;gt; 
      &amp;amp;lt;tr class="header"&amp;amp;gt;
        &amp;amp;lt;th&amp;amp;gt;Name&amp;amp;lt;/th&amp;amp;gt;
        &amp;amp;lt;th&amp;amp;gt;Version&amp;amp;lt;/th&amp;amp;gt;
        &amp;amp;lt;th&amp;amp;gt;Owner&amp;amp;lt;/th&amp;amp;gt;
        &amp;amp;lt;th&amp;amp;gt;&amp;amp;lt;/th&amp;amp;gt;
      &amp;amp;lt;/tr&amp;amp;gt;
  &amp;amp;lt;/thead&amp;amp;gt;
&lt;/pre&gt;
&lt;p&gt;The empty &lt;code&gt;&amp;amp;lt;th&amp;amp;gt;&lt;/code&gt; on there end there is for the column with our edit/delete actions. One final change and we&amp;#8217;ll be done. If you look in the helper for out WidgetController you&amp;#8217;ll see the following method:&lt;/p&gt;

&lt;pre&gt;
  def num_columns
    Widget.content_columns.length + 1
  end
&lt;/pre&gt;

&lt;p&gt;This method exists so that we can set the colspan for any of our inline forms (create, edit) in one place. The +1 is for the cell with the edit/delete actions. So we&amp;#8217;ll just explicitly set this as well:&lt;/p&gt;
&lt;pre&gt;
  def num_columns
    4
  end
&lt;/pre&gt;
&lt;p&gt;And there you go, thats all there is to customizing the scaffold object list.&lt;/p&gt;

&lt;h3&gt;Creating admin consoles using multiple scaffolds&lt;/h3&gt;

&lt;p&gt;One of the nice things about AjaxScaffolds is how easy it is to combine them to create an admin interface or drop them into existing pages. If you open &lt;em&gt; index.rhtml&lt;/em&gt; you find:&lt;/p&gt;
&lt;pre&gt;
&amp;amp;lt;%= render_component :controller =&amp;amp;gt; 'widget_console', :action =&amp;amp;gt; 'list' %&amp;amp;gt;
&lt;/pre&gt;
&lt;p&gt;Basically this means that the index action for our WidgetConsole controller is already using the scaffold as a Ruby on Rails component, this is good news as it makes it very simple to put these together. We&amp;#8217;ll go ahead and create a new controller named AdminConsole and an index.rhtml for it. Then we&amp;#8217;ll open up said index.rhtml and add the following lines:&lt;/p&gt;
&lt;pre&gt;
&amp;amp;lt;%= render_component :controller =&amp;amp;gt; 'widget_console', :action =&amp;amp;gt; 'list' %&amp;amp;gt;
&amp;amp;lt;%= render_component :controller =&amp;amp;gt; 'customer_console', :action =&amp;amp;gt; 'list' %&amp;amp;gt;
&lt;/pre&gt;

	&lt;p&gt;&lt;em&gt;As of release 3.0.0 this should be: &lt;/em&gt;&lt;/p&gt;


&lt;pre&gt;
&amp;amp;lt;%= render_component :controller =&amp;amp;gt; 'widget_console', :action =&amp;amp;gt; 'component', :params =&amp;gt; params %&amp;amp;gt;
&lt;/pre&gt;

&lt;p&gt;Now if we go to &lt;em&gt;/AdminConsole&lt;/em&gt; we should see both scaffolds on the same page (if you have an WidgetConsole and CustomerConsole controller). That&amp;#8217;s it! Granted your page looks a bit bare, but I&amp;#8217;ll assume you can setup the rest of the page around them. Similarly you can drop scaffolds into existing pages with the same code.&lt;/p&gt;

&lt;p&gt;Did I say &amp;#8220;that&amp;#8217;s it&amp;#8221; well I jumped the gun. There is still &lt;strong&gt;one more thing to do&lt;/strong&gt;. Since you love all your user&amp;#8217;s even the cute little ones that don&amp;#8217;t have JavaScript enabled you want to make sure they are taken care of as well. So as I wrote in my &lt;a href="http://www.height1percent.com/articles/2006/02/23/ajax-scaffold-generator-v2-1-0-released"&gt;previous post&lt;/a&gt; you&amp;#8217;ll need to change both the CustomerConsole and WidgetConsole controllers &lt;code&gt;return_to_main&lt;/code&gt; methods to look like so:

&lt;pre&gt;
  def return_to_main
    redirect_to :controller =&amp;gt; 'AdminConsole', :action =&amp;gt; 'index'
  end
&lt;/pre&gt;
&lt;p&gt;Make sure that whatever view you drop the scaffolds onto that the following  stylesheets and javascript files are in the header of your layout (and in the same order):&lt;/p&gt;

&lt;pre&gt;
  &amp;amp;lt;%= stylesheet_link_tag 'ajax_scaffold', :media =&amp;amp;gt; 'all' %&amp;amp;gt;
  &amp;amp;lt;%= javascript_include_tag 'prototype', 'effects', 'rico_corner', 'ajax_scaffold' %&amp;amp;gt;
&lt;/pre&gt;
There, now you &lt;strong&gt;really&lt;/strong&gt; are done!</description>
      <pubDate>Tue, 07 Mar 2006 01:38:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:2d365e0f3d47969a0917179d41a03939</guid>
      <author>Richard White</author>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components</link>
      <category>rails</category>
      <category>ajaxscaffold</category>
      <trackback:ping>http://www.height1percent.com/articles/trackback/21</trackback:ping>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Roupen N.</title>
      <description>&lt;p&gt;Hah, I am stuck right now trying to do exactly that&amp;#8230;  using the content_column method where Widget is in a belongs_to relationship. How do I do that? :-/&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;&amp;amp;lt;% for column in Widget.content_columns %&amp;amp;gt;
   &amp;amp;lt;%=h widget.send(column.name) %&amp;amp;gt;
 &amp;amp;lt;% end %&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Fri, 15 Feb 2008 21:03:06 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:7f904adf-6ee9-48fa-9e94-4bd24b72ba94</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-91524</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by David R</title>
      <description>&lt;p&gt;Thanks, Richard!&lt;/p&gt;</description>
      <pubDate>Sat, 01 Apr 2006 07:51:44 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-72</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Richard White</title>
      <description>&lt;p&gt;DavidR: &lt;a href="http://wiki.rubyonrails.com/rails/pages/Scaffolding"&gt;http://wiki.rubyonrails.com/rails/pages/Scaffolding&lt;/a&gt;+Extensions+Plugin&lt;/p&gt;</description>
      <pubDate>Fri, 31 Mar 2006 17:18:44 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-350</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by David R</title>
      <description>&lt;p&gt;Thanks. I&amp;#8217;m very much looking forward to it. BTW, who are those &amp;#8220;other guys&amp;#8221; and what is the name of their generator? TIA.&lt;/p&gt;</description>
      <pubDate>Thu, 30 Mar 2006 23:50:34 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-313</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Richard White</title>
      <description>&lt;p&gt;DavidR: It is a general Rails scaffold issue, one which I myself have never understood. Its on my plans at some point to try and add that ability to the AjaxScaffold, I&amp;#8217;ll have to dig into the base scaffold/ActiveRecord stuff to do it. Some other guys did some work where they extended :scaffold to do just what we are talking about I&amp;#8217;ll have to ask them how they did it.&lt;/p&gt;</description>
      <pubDate>Thu, 30 Mar 2006 15:19:48 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-347</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by David R</title>
      <description>&lt;p&gt;Great generator!!
But there&amp;#8217;s still one thing I&amp;#8217;m confused about. Perhaps this is a general Rails scaffold issue, but why doesn&amp;#8217;t it auto-generate template code for associations (belongs_to, has_many, etc)? It seems like it should be easy enough for Rails to spot the obvious associations and auto-generate the appropriate columns and lookup code, and it&amp;#8217;s a real hassle to always have to manually edit them in. Or is this already possible via parameters like:&lt;/p&gt;


	&lt;p&gt;&amp;#8220;ruby script/generate ajax_scaffold Item&amp;#8212;belongs_to category&amp;#8221;&lt;/p&gt;</description>
      <pubDate>Thu, 30 Mar 2006 14:35:19 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-346</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Richard White</title>
      <description>&lt;p&gt;wolfmanjm: You are correct. I didn&amp;#8217;t write that in there, but perhaps I should. Editing the form is much more straightforward since all the elements are explicitly given rather than the somewhat voodoo&amp;#8217;ish content_columns which is why I left that part out of this article (That and your listed columns need not be congruent to the elements you have exposed on your form).&lt;/p&gt;</description>
      <pubDate>Mon, 20 Mar 2006 03:51:10 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-284</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by wolfmanjm</title>
      <description>&lt;p&gt;If you also want to hide fields that you don&amp;#8217;t want to edit it seems that you also need to edit _form.rhtml  and remove those fields. The instructions above remove them from the list or table only.&lt;/p&gt;</description>
      <pubDate>Sun, 19 Mar 2006 22:40:14 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-300</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Richard White</title>
      <description>&lt;p&gt;Chuck: Sounds like you want to do the same things that Dean outlined in a&lt;a href="http://www.height1percent.com/articles/2006/03/14/impending-kiko-release-means-everything-else-goes-on-the-shelf"&gt;comment on another post&lt;/a&gt;. I&amp;#8217;ll be taking what he put together and doing a writeup / demo of that scenario this week.&lt;/p&gt;</description>
      <pubDate>Sat, 18 Mar 2006 22:20:36 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-290</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Chuck</title>
      <description>&lt;p&gt;I&amp;#8217;d like to be able to handle adding more elements to a drop down this way. For example, I&amp;#8217;ve got a list of projects and one of the columns is client. I&amp;#8217;d like to add a new client that would apprear in the list, it would be cool if I could add a create button that would then expand a div below the current one to add the new client using my clients scaffold. I&amp;#8217;ve tried this, but can&amp;#8217;t get it to work. Any pointers?&lt;/p&gt;


	&lt;p&gt;Thanks,&lt;/p&gt;


	&lt;p&gt;Chuck&lt;/p&gt;</description>
      <pubDate>Sat, 18 Mar 2006 20:10:20 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-286</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Richard White</title>
      <description>&lt;p&gt;Pawel: Thanks for pointing that out, I&amp;#8217;ll change that in the next version due out later on this week.&lt;/p&gt;</description>
      <pubDate>Sun, 12 Mar 2006 18:06:23 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-263</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Pawel</title>
      <description>&lt;p&gt;This is an excellent work you&amp;#8217;ve done! One thing, though&amp;#8230; I had problems with additional parameters to survive request eg. localization info. 
Changing index.rhtml to
&amp;lt;= render_component :controller =&amp;gt; &amp;#8216;widget_console&amp;#8217;, :action =&amp;gt; &amp;#8216;list&amp;#8217; , :params =&amp;gt; params&amp;gt;
or
&amp;lt;%= render_component params.merge(:controller =&amp;gt; &amp;#8216;widget_console&amp;#8217;, :action =&amp;gt; &amp;#8216;list&amp;#8217;) %&amp;gt;
solves the problem.
Anyway, I owe you couple of beers &amp;#8211; if you ever are in Poland :)&lt;/p&gt;</description>
      <pubDate>Sat, 11 Mar 2006 22:15:50 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-259</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Richard White</title>
      <description>&lt;p&gt;Daniel: Strange&amp;#8230; It looks like its requestings the right URL, not sure why it would give a 500 error on that. Honestly I did not test these changes on Safari or IE , because it seemed like a server side issue. I&amp;#8217;ll look at it on Safari this afternoon and get back to you.&lt;/p&gt;</description>
      <pubDate>Thu, 09 Mar 2006 19:30:15 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-243</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Daniel</title>
      <description>&lt;p&gt;This is great! Nice work. Just wanted to let you know that I generated a scaffold using a long modularized controller:&lt;/p&gt;


	&lt;p&gt;./script/generate ajax_scaffold Country &amp;#8216;intranet/sysadmin/lookup_tables/geographics/countries&amp;#8217;&lt;/p&gt;


	&lt;p&gt;When I load it in Safari, it simply displays a blank page and the webbrick log says:&lt;/p&gt;


	&lt;p&gt;127.0.0.1 &amp;#8211; - [09/Mar/2006:13:51:05 EST] &amp;#8220;GET /intranet/sysadmin/lookup_tables/geographics/countries HTTP/1.1&amp;#8221; 500 0
- -&amp;gt; /intranet/sysadmin/lookup_tables/geographics/countries&lt;/p&gt;


	&lt;p&gt;However, under FF it works just fine.&lt;/p&gt;</description>
      <pubDate>Thu, 09 Mar 2006 18:53:09 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-240</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Richard White</title>
      <description>&lt;p&gt;Sam: Did you regen? Can you email me your new.rhtml and the exact  command you used to generate the scaffold so I can try and reproduce. &lt;a href="mailto:rrwhite@gmail.com"&gt;rrwhite@gmail.com&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Wed, 08 Mar 2006 02:18:24 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-233</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Sam</title>
      <description>&lt;p&gt;Hmm i&amp;#8217;m still getting an error of&lt;/p&gt;


	&lt;p&gt;&amp;#8220;Routing Error&lt;/p&gt;


	&lt;p&gt;Recognition failed for &amp;#8221;/news/new&amp;#8221;&amp;#8220;&lt;/p&gt;


	&lt;p&gt;when i click on Create New.&lt;/p&gt;</description>
      <pubDate>Wed, 08 Mar 2006 02:13:19 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-231</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Richard White</title>
      <description>&lt;p&gt;Sam: I&amp;#8217;ve put out a bug fix release to address the RoutingError issue. Thanks for the heads up.&lt;/p&gt;</description>
      <pubDate>Tue, 07 Mar 2006 23:13:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-229</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Richard White</title>
      <description>&lt;p&gt;Sam: You aren&amp;#8217;t doing anything wrong that&amp;#8217;s a current bug that I just was made aware of last night. There is an easy workaround for it that I&amp;#8217;ll post in a few and I should have a patch out for it by the end of the week.&lt;/p&gt;</description>
      <pubDate>Tue, 07 Mar 2006 21:38:32 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-223</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Sam</title>
      <description>&lt;p&gt;First off, just wanted to say thanks for relasing a great scaffold. Its really quite marvelous.&lt;/p&gt;


	&lt;p&gt;Secondly, I&amp;#8217;m having problems when i try to bundle this scaffolding into a module. I generate the module with &amp;#8216;script/generate ajax_scaffold NewsItem admin::news&amp;#8217;.  I think define everything so when i go to admin/news it renders the proper controller. However if i click on Create New, or Edit, i get this error: &amp;#8220;Routing Error&lt;/p&gt;


	&lt;p&gt;Recognition failed for &amp;#8221;/admin::news/new&amp;#8221;&amp;#8220;&lt;/p&gt;


	&lt;p&gt;Is there something i&amp;#8217;m doing wrong? if so what should i change?&lt;/p&gt;</description>
      <pubDate>Tue, 07 Mar 2006 21:11:02 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-222</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Richard White</title>
      <description>&lt;p&gt;Dean: You know I hadn&amp;#8217;t actually thought about using the scaffold for child associations, I&amp;#8217;ll ponder that one and perhaps come up with an article on that later on this week. I&amp;#8217;d also almost consider changing the default content_columns on the generated code, but that might be a tad confusing. Anyways thanks for the tip.&lt;/p&gt;</description>
      <pubDate>Tue, 07 Mar 2006 16:27:32 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-219</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Dean</title>
      <description>&lt;p&gt;One other note:  If you don&amp;#8217;t have associations, the easiest way I&amp;#8217;ve found to adapt the columns is to override the content_columns in the model&amp;#8230; I did it like this:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;def self.content_columns
  @content_columns ||= Customer.columns.reject { |c| c.primary || c.name =~ /(_id|_count|_at|_on|notes)$/ || c.name == inheritance_column }
end&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;to eliminate the _at, _on and notes columns.&lt;/p&gt;</description>
      <pubDate>Tue, 07 Mar 2006 14:43:24 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-217</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by Dean</title>
      <description>&lt;p&gt;This is really starting to wrap up to be the highlight of rail for me, Richard.    The piece that I need to figure out to make this work well for me is how to tie it fully as a child.   This shows how to display in the list the name of the owner.  But the next step is to tie this to an owner on insert/update.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m getting there, but this is the key part for me.  My thought is to choose a parent record, show key details of it on the top of the page, then all child records would be listed, inserted,etc.&lt;/p&gt;


	&lt;p&gt;So keep up the good work!!!  These scaffolds are going to be a great thing as time goes on.&lt;/p&gt;</description>
      <pubDate>Tue, 07 Mar 2006 14:40:40 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-216</link>
    </item>
    <item>
      <title>"AjaxScaffold lessons: Customizing the display columns and using scaffolds as components " by ian</title>
      <description>&lt;p&gt;awesome, thanks, richard.&lt;/p&gt;</description>
      <pubDate>Tue, 07 Mar 2006 12:09:27 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:</guid>
      <link>http://www.height1percent.com/articles/2006/03/07/ajaxscaffold-lessons-customizing-the-display-columns-and-using-the-scaffolds-as-components#comment-215</link>
    </item>
  </channel>
</rss>
