<?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: Checkbox list in Ruby on Rails using HABTM</title>
	<atom:link href="http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/</link>
	<description>Life is an optimization issue</description>
	<lastBuildDate>Fri, 12 Mar 2010 05:32:38 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9-rare</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: arun</title>
		<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/comment-page-1/#comment-6952</link>
		<dc:creator>arun</dc:creator>
		<pubDate>Wed, 13 Jan 2010 08:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinball.com/?p=567#comment-6952</guid>
		<description>Thanks for the awesome post</description>
		<content:encoded><![CDATA[<p>Thanks for the awesome post</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jjinux</title>
		<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/comment-page-1/#comment-6906</link>
		<dc:creator>jjinux</dc:creator>
		<pubDate>Wed, 11 Nov 2009 07:16:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinball.com/?p=567#comment-6906</guid>
		<description>Grab the records.  In your template, use a loop ;)</description>
		<content:encoded><![CDATA[<p>Grab the records.  In your template, use a loop <img src='http://www.justinball.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: akellakarthik</title>
		<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/comment-page-1/#comment-6899</link>
		<dc:creator>akellakarthik</dc:creator>
		<pubDate>Wed, 04 Nov 2009 11:29:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinball.com/?p=567#comment-6899</guid>
		<description>i am new to ROR. i am trying to create a checkbox list by values which i retrive from database table. How can i acheive this?</description>
		<content:encoded><![CDATA[<p>i am new to ROR. i am trying to create a checkbox list by values which i retrive from database table. How can i acheive this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jjinux</title>
		<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/comment-page-1/#comment-6817</link>
		<dc:creator>jjinux</dc:creator>
		<pubDate>Mon, 10 Aug 2009 20:18:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinball.com/?p=567#comment-6817</guid>
		<description>I think that&#039;s what &lt;a href=&quot;http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html&quot; rel=&quot;nofollow&quot;&gt;http://api.rubyonrails.org/classes/ActiveRecord...&lt;/a&gt; is for.  This might help: &lt;a href=&quot;http://ruby.meetup.com/81/calendar/10852438/&quot; rel=&quot;nofollow&quot;&gt;http://ruby.meetup.com/81/calendar/10852438/&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>I think that&#39;s what <a href="http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html" rel="nofollow"></a><a href="http://api.rubyonrails.org/classes/ActiveRecord" rel="nofollow">http://api.rubyonrails.org/classes/ActiveRecord</a>&#8230; is for.  This might help: <a href="http://ruby.meetup.com/81/calendar/10852438/" rel="nofollow">http://ruby.meetup.com/81/calendar/10852438/</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mkrx</title>
		<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/comment-page-1/#comment-6816</link>
		<dc:creator>mkrx</dc:creator>
		<pubDate>Mon, 10 Aug 2009 13:37:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinball.com/?p=567#comment-6816</guid>
		<description>JJ, thanks for that.  You&#039;ve opened up a new world on the security front.  I&#039;ll have to study it before I can implement it.&lt;br&gt;&lt;br&gt;Still, I need a way with the great code that you and Justin have supplied to update a &#039;third&#039; field in the join record.  What I have is a join record that does a HATBM with &#039;races&#039; and &#039;tshirts&#039;.  Our clients want to be able to assign different tshirt sizes from a pick list (which I&#039;ve put into the DB) and possibly have a &#039;price adder&#039; for large or special shirts.&lt;br&gt;&lt;br&gt;With your code above is there an easy way to pass in an array of &#039;price adder&#039; fields (most of which will be zero) and then pass them into the join record in the controller on create or update?&lt;br&gt;&lt;br&gt;Would it be something like...&lt;br&gt;&lt;br&gt;params[:race][:tshirt_ids].merge(:price_addr =&gt; params[:price_addr][]) &#124;&#124;= []&lt;br&gt;&lt;br&gt;...? I&#039;m assuming I would create an array somehow in the view of price_addr[], similar to tshirt_ids (over my head here).  The code above won&#039;t work, because I&#039;m mixing type String with Array in the merge(), but I&#039;m guessing if it can be done its a short bit of code.&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Mark</description>
		<content:encoded><![CDATA[<p>JJ, thanks for that.  You&#39;ve opened up a new world on the security front.  I&#39;ll have to study it before I can implement it.</p>
<p>Still, I need a way with the great code that you and Justin have supplied to update a &#39;third&#39; field in the join record.  What I have is a join record that does a HATBM with &#39;races&#39; and &#39;tshirts&#39;.  Our clients want to be able to assign different tshirt sizes from a pick list (which I&#39;ve put into the DB) and possibly have a &#39;price adder&#39; for large or special shirts.</p>
<p>With your code above is there an easy way to pass in an array of &#39;price adder&#39; fields (most of which will be zero) and then pass them into the join record in the controller on create or update?</p>
<p>Would it be something like&#8230;</p>
<p>params[:race][:tshirt_ids].merge(:price_addr =&gt; params[:price_addr][]) ||= []</p>
<p>&#8230;? I&#39;m assuming I would create an array somehow in the view of price_addr[], similar to tshirt_ids (over my head here).  The code above won&#39;t work, because I&#39;m mixing type String with Array in the merge(), but I&#39;m guessing if it can be done its a short bit of code.</p>
<p>Thanks,<br />Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jjinux</title>
		<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/comment-page-1/#comment-6815</link>
		<dc:creator>jjinux</dc:creator>
		<pubDate>Mon, 10 Aug 2009 08:50:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinball.com/?p=567#comment-6815</guid>
		<description>Yes, you *can* add rows to the join table using the vulnerability you linked to.  I talked about it at length, including the solution I settled on, here: &lt;a href=&quot;http://jjinux.blogspot.com/2009/07/rails-configuring-admins-checkboxes-and.html&quot; rel=&quot;nofollow&quot;&gt;http://jjinux.blogspot.com/2009/07/rails-config...&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Yes, you *can* add rows to the join table using the vulnerability you linked to.  I talked about it at length, including the solution I settled on, here: <a href="http://jjinux.blogspot.com/2009/07/rails-configuring-admins-checkboxes-and.html" rel="nofollow"></a><a href="http://jjinux.blogspot.com/2009/07/rails-config" rel="nofollow">http://jjinux.blogspot.com/2009/07/rails-config</a>&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jjinux</title>
		<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/comment-page-1/#comment-6814</link>
		<dc:creator>jjinux</dc:creator>
		<pubDate>Mon, 10 Aug 2009 08:48:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinball.com/?p=567#comment-6814</guid>
		<description>I think what you&#039;re looking for is has_many :through.</description>
		<content:encoded><![CDATA[<p>I think what you&#39;re looking for is has_many :through.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jbasdf</title>
		<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/comment-page-1/#comment-6813</link>
		<dc:creator>jbasdf</dc:creator>
		<pubDate>Mon, 10 Aug 2009 02:54:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinball.com/?p=567#comment-6813</guid>
		<description>Be sure to checkout the link above (&lt;a href=&quot;http://railspikes.com/2008/9/22/is-your-rails-application-safe-from-mass-assignment&quot; rel=&quot;nofollow&quot;&gt;http://railspikes.com/2008/9/22/is-your-rails-a...&lt;/a&gt;) so that you don&#039;t have security problems.  I&#039;m not sure that there is an easy way to add items to the join table using this method.  You might take a look at this &lt;a href=&quot;http://guides.rubyonrails.org/2_3_release_notes.html#nested-attributes&quot; rel=&quot;nofollow&quot;&gt;http://guides.rubyonrails.org/2_3_release_notes...&lt;/a&gt; to see if this will help.  It would require a bit of architecture change, but using nested attributes might give you more control.</description>
		<content:encoded><![CDATA[<p>Be sure to checkout the link above (<a href="http://railspikes.com/2008/9/22/is-your-rails-application-safe-from-mass-assignment" rel="nofollow"></a><a href="http://railspikes.com/2008/9/22/is-your-rails-a" rel="nofollow">http://railspikes.com/2008/9/22/is-your-rails-a</a>&#8230;) so that you don&#39;t have security problems.  I&#39;m not sure that there is an easy way to add items to the join table using this method.  You might take a look at this <a href="http://guides.rubyonrails.org/2_3_release_notes.html#nested-attributes" rel="nofollow"></a><a href="http://guides.rubyonrails.org/2_3_release_notes" rel="nofollow">http://guides.rubyonrails.org/2_3_release_notes</a>&#8230; to see if this will help.  It would require a bit of architecture change, but using nested attributes might give you more control.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mkrx</title>
		<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/comment-page-1/#comment-6811</link>
		<dc:creator>mkrx</dc:creator>
		<pubDate>Sun, 09 Aug 2009 20:46:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinball.com/?p=567#comment-6811</guid>
		<description>Well... I see the code, I put it into my code, I run it, it works... freakin&#039; magic!  I don&#039;t see how it creates and deletes the join records.  Once again... amazing!&lt;br&gt;&lt;br&gt;How would you set a &#039;third field&#039; in the join record?  We are doing sign-ups for races, and I&#039;ve taken your example and created a race_tshirts join table.  I want to add a &#039;price_adder&#039; field in the join table for larger or special tshirts.  Any suggestions would be very helpful.&lt;br&gt;&lt;br&gt;Mark</description>
		<content:encoded><![CDATA[<p>Well&#8230; I see the code, I put it into my code, I run it, it works&#8230; freakin&#39; magic!  I don&#39;t see how it creates and deletes the join records.  Once again&#8230; amazing!</p>
<p>How would you set a &#39;third field&#39; in the join record?  We are doing sign-ups for races, and I&#39;ve taken your example and created a race_tshirts join table.  I want to add a &#39;price_adder&#39; field in the join table for larger or special tshirts.  Any suggestions would be very helpful.</p>
<p>Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jjinux</title>
		<link>http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/comment-page-1/#comment-6797</link>
		<dc:creator>jjinux</dc:creator>
		<pubDate>Wed, 29 Jul 2009 20:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.justinball.com/?p=567#comment-6797</guid>
		<description>I blogged about this whole experience, including how I addressed the vulnerability here: &lt;a href=&quot;http://jjinux.blogspot.com/2009/07/rails-configuring-admins-checkboxes-and.html&quot; rel=&quot;nofollow&quot;&gt;http://jjinux.blogspot.com/2009/07/rails-config...&lt;/a&gt;&lt;br&gt;&lt;br&gt;Thanks again!</description>
		<content:encoded><![CDATA[<p>I blogged about this whole experience, including how I addressed the vulnerability here: <a href="http://jjinux.blogspot.com/2009/07/rails-configuring-admins-checkboxes-and.html" rel="nofollow"></a><a href="http://jjinux.blogspot.com/2009/07/rails-config" rel="nofollow">http://jjinux.blogspot.com/2009/07/rails-config</a>&#8230;</p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
