<?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: Easy Form Drop-Downs With Collection_Select</title>
	<atom:link href="http://www.railsrocket.com/easy-form-drop-downs-with-collection_select/feed" rel="self" type="application/rss+xml" />
	<link>http://www.railsrocket.com/easy-form-drop-downs-with-collection_select</link>
	<description>A Ruby on Rails community website with tutorials</description>
	<lastBuildDate>Thu, 25 Mar 2010 23:45:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Trung</title>
		<link>http://www.railsrocket.com/easy-form-drop-downs-with-collection_select/comment-page-1#comment-3136</link>
		<dc:creator>Trung</dc:creator>
		<pubDate>Thu, 30 Jul 2009 01:40:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsrocket.com/articles/?p=22#comment-3136</guid>
		<description>@ashes999: Thanks for your reply. I have tried with collection_select but no progress. So I have found another solution by using select. For examples:

select(&quot;sales_agent&quot;, &quot;customer_id&quot;, @customers.collect{&#124;customer&#124; [customer.name(params), id]})

With this, you can call any instance function with params. 
Hope this help for somebody.

@Bryan: Have you tried to put &quot;,&quot; before {:selected =&gt; ...} in your code?

Thanks and regards.</description>
		<content:encoded><![CDATA[<p>@ashes999: Thanks for your reply. I have tried with collection_select but no progress. So I have found another solution by using select. For examples:</p>
<p>select(&#8220;sales_agent&#8221;, &#8220;customer_id&#8221;, @customers.collect{|customer| [customer.name(params), id]})</p>
<p>With this, you can call any instance function with params.<br />
Hope this help for somebody.</p>
<p>@Bryan: Have you tried to put &#8220;,&#8221; before {:selected =&gt; &#8230;} in your code?</p>
<p>Thanks and regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ashes999</title>
		<link>http://www.railsrocket.com/easy-form-drop-downs-with-collection_select/comment-page-1#comment-3134</link>
		<dc:creator>ashes999</dc:creator>
		<pubDate>Wed, 29 Jul 2009 17:09:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsrocket.com/articles/?p=22#comment-3134</guid>
		<description>@Brian: sorry, no clue
@Trung: I&#039;m not sure. I assume if you put a function name, Rails will call the function and use the return value as the attribute. Why not try it, and let me know how it works out?</description>
		<content:encoded><![CDATA[<p>@Brian: sorry, no clue<br />
@Trung: I&#8217;m not sure. I assume if you put a function name, Rails will call the function and use the return value as the attribute. Why not try it, and let me know how it works out?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trung</title>
		<link>http://www.railsrocket.com/easy-form-drop-downs-with-collection_select/comment-page-1#comment-3131</link>
		<dc:creator>Trung</dc:creator>
		<pubDate>Wed, 29 Jul 2009 10:06:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsrocket.com/articles/?p=22#comment-3131</guid>
		<description>Hi, 

I have a question:

What if &quot;display_field&quot; is a virtual attribute which contains parameters?

In your example, assume that to calculate the &quot;name&quot; attribute, we need to pass a parameter &quot;language&quot;. So how can we use the collection_select in this case?

Thank you in advance.</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>I have a question:</p>
<p>What if &#8220;display_field&#8221; is a virtual attribute which contains parameters?</p>
<p>In your example, assume that to calculate the &#8220;name&#8221; attribute, we need to pass a parameter &#8220;language&#8221;. So how can we use the collection_select in this case?</p>
<p>Thank you in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://www.railsrocket.com/easy-form-drop-downs-with-collection_select/comment-page-1#comment-2897</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Tue, 23 Jun 2009 15:52:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsrocket.com/articles/?p=22#comment-2897</guid>
		<description> searcher.get_approver}) %&gt;</description>
		<content:encoded><![CDATA[<p>searcher.get_approver}) %&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan</title>
		<link>http://www.railsrocket.com/easy-form-drop-downs-with-collection_select/comment-page-1#comment-2896</link>
		<dc:creator>Bryan</dc:creator>
		<pubDate>Tue, 23 Jun 2009 15:51:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsrocket.com/articles/?p=22#comment-2896</guid>
		<description>On this helper, what would be the best way to select a default?

example
 searcher.get_approver}) %&gt;

This throws an error
Syntax error, unexpected &#039;{&#039;, expecting &#039;)&#039;
... @approvers, :id, :full_name {:selected =&gt; searcher.get_appr...

I would also like an option for : &quot;Create New Approver&quot; which links to Approver.new

Any ideas would be appreciated.

On a secondary question;
I have on the same form, a set of radio-buttons. I would like the toggle to enable or disable this collection_select control

Thanks</description>
		<content:encoded><![CDATA[<p>On this helper, what would be the best way to select a default?</p>
<p>example<br />
 searcher.get_approver}) %&gt;</p>
<p>This throws an error<br />
Syntax error, unexpected &#8216;{&#8216;, expecting &#8216;)&#8217;<br />
&#8230; @approvers, :id, :full_name {:selected =&gt; searcher.get_appr&#8230;</p>
<p>I would also like an option for : &#8220;Create New Approver&#8221; which links to Approver.new</p>
<p>Any ideas would be appreciated.</p>
<p>On a secondary question;<br />
I have on the same form, a set of radio-buttons. I would like the toggle to enable or disable this collection_select control</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lex</title>
		<link>http://www.railsrocket.com/easy-form-drop-downs-with-collection_select/comment-page-1#comment-2648</link>
		<dc:creator>Lex</dc:creator>
		<pubDate>Sat, 23 May 2009 04:57:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsrocket.com/articles/?p=22#comment-2648</guid>
		<description>The current signature is the following:

collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {})

Sample usage (selecting the associated Author for an instance of Post, @post):

collection_select(:post, :author_id, Author.find(:all), :id, :name_with_initial, {:prompt =&gt; true})

Thanks for the article.</description>
		<content:encoded><![CDATA[<p>The current signature is the following:</p>
<p>collection_select(object, method, collection, value_method, text_method, options = {}, html_options = {})</p>
<p>Sample usage (selecting the associated Author for an instance of Post, @post):</p>
<p>collection_select(:post, :author_id, Author.find(:all), :id, :name_with_initial, {:prompt =&gt; true})</p>
<p>Thanks for the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ashes999</title>
		<link>http://www.railsrocket.com/easy-form-drop-downs-with-collection_select/comment-page-1#comment-2280</link>
		<dc:creator>ashes999</dc:creator>
		<pubDate>Wed, 29 Apr 2009 10:48:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsrocket.com/articles/?p=22#comment-2280</guid>
		<description>@Justin: If you look at the original HTML, you&#039;ll see: name=&quot;sales_agent[customer_id]&quot;. The Rails code generates equivalent HTML; it already follows the convention Rails knows, so it should automatically populate sales_agent[customer_id].</description>
		<content:encoded><![CDATA[<p>@Justin: If you look at the original HTML, you&#8217;ll see: name=&#8221;sales_agent[customer_id]&#8220;. The Rails code generates equivalent HTML; it already follows the convention Rails knows, so it should automatically populate sales_agent[customer_id].</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.railsrocket.com/easy-form-drop-downs-with-collection_select/comment-page-1#comment-2262</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Wed, 29 Apr 2009 01:11:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.railsrocket.com/articles/?p=22#comment-2262</guid>
		<description>Okay, great, but this doesn&#039;t explain at all how to use it.  How do you get the selected option when you are in the controller?  Rails documentation is significantly lacking in every aspect.</description>
		<content:encoded><![CDATA[<p>Okay, great, but this doesn&#8217;t explain at all how to use it.  How do you get the selected option when you are in the controller?  Rails documentation is significantly lacking in every aspect.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

