<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Dynamic Columns with Ajax Scaffold</title>
	<atom:link href="http://blog.thatsuseful.com/2006/10/28/dynamic-columns-with-ajax-scaffold/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thatsuseful.com/2006/10/28/dynamic-columns-with-ajax-scaffold/</link>
	<description>Life on and off the Rails</description>
	<lastBuildDate>Wed, 20 Aug 2008 17:47:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Jonathan Donaldson</title>
		<link>http://blog.thatsuseful.com/2006/10/28/dynamic-columns-with-ajax-scaffold/comment-page-1/#comment-363</link>
		<dc:creator>Jonathan Donaldson</dc:creator>
		<pubDate>Sat, 28 Oct 2006 06:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.caronsoftware.com/2007/11/25/dynamic-columns-with-ajax-scaffold#comment-363</guid>
		<description>Scott,

First off, thanks for both the nice response, and the plugin...it is making my life much easier.

Second, once you showed this, I found (at least to me) an easier way to do the column filtering....

I went ahead and did the usual:
&lt;pre&gt;&lt;code&gt;
@@scaffold_columns = [
AjaxScaffold::ScaffoldColumn.new(...),
AjaxScaffold::ScaffoldColumn.new(...)
]
&lt;/code&gt;&lt;/pre&gt;
for each of the common columns (ones that each user should see), then I did this in the def create_columns:
&lt;pre&gt;&lt;code&gt;
def create_columns
     if @user.is_admin?
         @@scaffold_columns.insert(2,AjaxScaffold::ScaffoldColumn.new(...admin only column)
     end
end
&lt;/code&gt;&lt;/pre&gt;

you can use the array insert to put a column before or after any of the ones set previously...(integer after .insert( is the position)

Thanks again for all the hard work!</description>
		<content:encoded><![CDATA[<p>Scott,</p>
<p>First off, thanks for both the nice response, and the plugin&#8230;it is making my life much easier.</p>
<p>Second, once you showed this, I found (at least to me) an easier way to do the column filtering&#8230;.</p>
<p>I went ahead and did the usual:<br />
&lt;pre&gt;&lt;code&gt;<br />
@@scaffold_columns = [<br />
AjaxScaffold::ScaffoldColumn.new(...),<br />
AjaxScaffold::ScaffoldColumn.new(...)<br />
]<br />
&lt;/code&gt;&lt;/pre&gt;<br />
for each of the common columns (ones that each user should see), then I did this in the def create_columns:<br />
&lt;pre&gt;&lt;code&gt;<br />
def create_columns<br />
     if @user.is_admin?<br />
         @@scaffold_columns.insert(2,AjaxScaffold::ScaffoldColumn.new(&#8230;admin only column)<br />
     end<br />
end<br />
&lt;/code&gt;&lt;/pre&gt;</p>
<p>you can use the array insert to put a column before or after any of the ones set previously&#8230;(integer after .insert( is the position)</p>
<p>Thanks again for all the hard work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Rutherford</title>
		<link>http://blog.thatsuseful.com/2006/10/28/dynamic-columns-with-ajax-scaffold/comment-page-1/#comment-364</link>
		<dc:creator>Scott Rutherford</dc:creator>
		<pubDate>Sat, 28 Oct 2006 06:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.caronsoftware.com/2007/11/25/dynamic-columns-with-ajax-scaffold#comment-364</guid>
		<description>Hi Jonathon, that looks pretty neat. I suspect there are a few more ways too. All good.

Cheers
Scott.</description>
		<content:encoded><![CDATA[<p>Hi Jonathon, that looks pretty neat. I suspect there are a few more ways too. All good.</p>
<p>Cheers<br />
Scott.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Donaldson</title>
		<link>http://blog.thatsuseful.com/2006/10/28/dynamic-columns-with-ajax-scaffold/comment-page-1/#comment-365</link>
		<dc:creator>Jonathan Donaldson</dc:creator>
		<pubDate>Sat, 28 Oct 2006 06:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.caronsoftware.com/2007/11/25/dynamic-columns-with-ajax-scaffold#comment-365</guid>
		<description>Hmmm...my thought above works great in development, but once I tried in production mode, it looks like it caches the @@scaffold_columns and goes through create_colums each time, so I end up with lots if repeats of &#039;admin&#039; columns...

any ideas?</description>
		<content:encoded><![CDATA[<p>Hmmm&#8230;my thought above works great in development, but once I tried in production mode, it looks like it caches the @@scaffold_columns and goes through create_colums each time, so I end up with lots if repeats of &#8216;admin&#8217; columns&#8230;</p>
<p>any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Rutherford</title>
		<link>http://blog.thatsuseful.com/2006/10/28/dynamic-columns-with-ajax-scaffold/comment-page-1/#comment-366</link>
		<dc:creator>Scott Rutherford</dc:creator>
		<pubDate>Sat, 28 Oct 2006 06:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.caronsoftware.com/2007/11/25/dynamic-columns-with-ajax-scaffold#comment-366</guid>
		<description>Hi Jonathon, ah yes, should of thought of that. I think the hash direction I originally outlined would be your best bet. Then the actual column objects are only instantiated once but you can dynamically assign them on each request. As you completely overriding the @@scaffold_columns array you won&#039;t have this problem.

Cheers
Scott.</description>
		<content:encoded><![CDATA[<p>Hi Jonathon, ah yes, should of thought of that. I think the hash direction I originally outlined would be your best bet. Then the actual column objects are only instantiated once but you can dynamically assign them on each request. As you completely overriding the @@scaffold_columns array you won&#8217;t have this problem.</p>
<p>Cheers<br />
Scott.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorge L. Cangas</title>
		<link>http://blog.thatsuseful.com/2006/10/28/dynamic-columns-with-ajax-scaffold/comment-page-1/#comment-367</link>
		<dc:creator>Jorge L. Cangas</dc:creator>
		<pubDate>Sat, 28 Oct 2006 06:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.caronsoftware.com/2007/11/25/dynamic-columns-with-ajax-scaffold#comment-367</guid>
		<description>Well I&#039;m just starting with ajaxscaffold ... My problem is I want show a *few* columns in the grid view and *many* columns in the edit view. I tried the @@scaffold_columns way and I think my problem is related with the previous comments, but I&#039;m also new in Ruby. Can help me, please?</description>
		<content:encoded><![CDATA[<p>Well I&#8217;m just starting with ajaxscaffold &#8230; My problem is I want show a *few* columns in the grid view and *many* columns in the edit view. I tried the @@scaffold_columns way and I think my problem is related with the previous comments, but I&#8217;m also new in Ruby. Can help me, please?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Rutherford</title>
		<link>http://blog.thatsuseful.com/2006/10/28/dynamic-columns-with-ajax-scaffold/comment-page-1/#comment-368</link>
		<dc:creator>Scott Rutherford</dc:creator>
		<pubDate>Sat, 28 Oct 2006 06:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.caronsoftware.com/2007/11/25/dynamic-columns-with-ajax-scaffold#comment-368</guid>
		<description>Hi Jorge, to do this you will need to use the @scaffold_columns to define the grid view and create a custom _form.rhtml template for the edit view.

Cheers
Scott.</description>
		<content:encoded><![CDATA[<p>Hi Jorge, to do this you will need to use the @scaffold_columns to define the grid view and create a custom _form.rhtml template for the edit view.</p>
<p>Cheers<br />
Scott.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorge L. Cangas</title>
		<link>http://blog.thatsuseful.com/2006/10/28/dynamic-columns-with-ajax-scaffold/comment-page-1/#comment-369</link>
		<dc:creator>Jorge L. Cangas</dc:creator>
		<pubDate>Sat, 28 Oct 2006 06:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.caronsoftware.com/2007/11/25/dynamic-columns-with-ajax-scaffold#comment-369</guid>
		<description>Thanks a lot: just this was my intuitive guess, but I find for some most &quot;generic&quot;: I have some internal fields I need in each table. My feeling is Ajax-Scaffold is very good at &quot;entry level&quot; but it goes difficultd in more complex views: A master/detail form fo example. Well maybe I must wait for AS 4.0 :-).  I&#039;m tried also streamlinned framework for the same, but it seems immature for now for my work. Sorry if all these feelings is my low expertise in RoR, I don&#039;t sure but I&#039;m learning hard
Thansk! (sorry also my limited english)</description>
		<content:encoded><![CDATA[<p>Thanks a lot: just this was my intuitive guess, but I find for some most &quot;generic&quot;: I have some internal fields I need in each table. My feeling is Ajax-Scaffold is very good at &quot;entry level&quot; but it goes difficultd in more complex views: A master/detail form fo example. Well maybe I must wait for AS 4.0 <img src='http://blog.thatsuseful.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .  I&#8217;m tried also streamlinned framework for the same, but it seems immature for now for my work. Sorry if all these feelings is my low expertise in RoR, I don&#8217;t sure but I&#8217;m learning hard<br />
Thansk! (sorry also my limited english)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Wattenmaker</title>
		<link>http://blog.thatsuseful.com/2006/10/28/dynamic-columns-with-ajax-scaffold/comment-page-1/#comment-370</link>
		<dc:creator>Jeff Wattenmaker</dc:creator>
		<pubDate>Sat, 28 Oct 2006 06:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.caronsoftware.com/2007/11/25/dynamic-columns-with-ajax-scaffold#comment-370</guid>
		<description>Hi

I tried implementing this with a controller and table that has:&lt;br&gt;

:suffix =&gt; true&lt;br&gt;

On my column hash I get an error:

uninitialized class variable @@columns_hash in TeamController

I have tried naming the hash both columns_hash and users_columns_hash with the same result.

this is the code in the controller.

  @@users_columns_hash[:user] = AjaxScaffold::ScaffoldColumn.new(:name =&gt; &#039;first&#039;, :name =&gt; &#039;last&#039;)
  @@users_columns_hash[:foo] = AjaxScaffold::ScaffoldColumn.new(:name =&gt; &#039;email&#039;)


I have also tried without the AjaxScaffold:: before ScaffoldColumn and same result.

Assume I am doing something wrong, can you help.

thanks.

Jeff</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>I tried implementing this with a controller and table that has:&lt;br&gt;</p>
<p>:suffix =&gt; true&lt;br&gt;</p>
<p>On my column hash I get an error:</p>
<p>uninitialized class variable @@columns_hash in TeamController</p>
<p>I have tried naming the hash both columns_hash and users_columns_hash with the same result.</p>
<p>this is the code in the controller.</p>
<p>  @@users_columns_hash[:user] = AjaxScaffold::ScaffoldColumn.new(:name =&gt; &#8216;first&#8217;, :name =&gt; &#8216;last&#8217;)<br />
  @@users_columns_hash[:foo] = AjaxScaffold::ScaffoldColumn.new(:name =&gt; &#8216;email&#8217;)</p>
<p>I have also tried without the AjaxScaffold:: before ScaffoldColumn and same result.</p>
<p>Assume I am doing something wrong, can you help.</p>
<p>thanks.</p>
<p>Jeff</p>
]]></content:encoded>
	</item>
</channel>
</rss>
