<?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: How to dynamically update form elements in Rails using Ajax</title>
	<atom:link href="http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/</link>
	<description></description>
	<lastBuildDate>Tue, 12 Jan 2010 15:47:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: FSS</title>
		<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/comment-page-1/#comment-14874</link>
		<dc:creator>FSS</dc:creator>
		<pubDate>Tue, 12 Jan 2010 15:47:05 +0000</pubDate>
		<guid isPermaLink="false">http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/#comment-14874</guid>
		<description>Thank you very much!!  I´m an experienced programmer but newbie in ruby and rails, ajax and all that jazz and in a rush. All examples found even in books are too simple to be applied. Others in forums get into innecesary trouble. This one is closer to my needs (the two selects come from 2 different tables, and inside a form_for) and updating directly over the named select allowed me to get the job done with really minor changes (the find clause didn´t work for me in that format).  Good job Neal.</description>
		<content:encoded><![CDATA[<p>Thank you very much!!  I´m an experienced programmer but newbie in ruby and rails, ajax and all that jazz and in a rush. All examples found even in books are too simple to be applied. Others in forums get into innecesary trouble. This one is closer to my needs (the two selects come from 2 different tables, and inside a form_for) and updating directly over the named select allowed me to get the job done with really minor changes (the find clause didn´t work for me in that format).  Good job Neal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bonyiii</title>
		<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/comment-page-1/#comment-11461</link>
		<dc:creator>bonyiii</dc:creator>
		<pubDate>Thu, 30 Apr 2009 10:14:45 +0000</pubDate>
		<guid isPermaLink="false">http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/#comment-11461</guid>
		<description>Hi i use &quot;remote_function&quot; within the select element, so i don&#039;t need observer. Just thought to share it:

remote_function(
{ :controller =&gt; &quot;test&quot;,:action =&gt; &quot;get_cities&quot; },
:update=&gt;:cities,
:with =&gt; &quot;city_id&quot;
)
} %&gt;</description>
		<content:encoded><![CDATA[<p>Hi i use &#8220;remote_function&#8221; within the select element, so i don&#8217;t need observer. Just thought to share it:</p>
<p>remote_function(<br />
{ :controller =&gt; &#8220;test&#8221;,:action =&gt; &#8220;get_cities&#8221; },<br />
:update=&gt;:cities,<br />
:with =&gt; &#8220;city_id&#8221;<br />
)<br />
} %&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack Zelig</title>
		<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/comment-page-1/#comment-11344</link>
		<dc:creator>Jack Zelig</dc:creator>
		<pubDate>Sun, 26 Apr 2009 18:17:36 +0000</pubDate>
		<guid isPermaLink="false">http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/#comment-11344</guid>
		<description>Mail is &quot;jack dot zelig at gmail dot com&quot;
by the way</description>
		<content:encoded><![CDATA[<p>Mail is &#8220;jack dot zelig at gmail dot com&#8221;<br />
by the way</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack Zelig</title>
		<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/comment-page-1/#comment-11343</link>
		<dc:creator>Jack Zelig</dc:creator>
		<pubDate>Sun, 26 Apr 2009 18:16:12 +0000</pubDate>
		<guid isPermaLink="false">http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/#comment-11343</guid>
		<description>Hi,
Thanks for the tutorial. I used this to great effect on the form I am designing for work.
However, one major issue is that the dynamically created menus don&#039;t survive a page refresh. That is, if you press submit, the form flags an error and thus re-renders itself (highlighting the errors) then the dynamically created menu vanishes (only the initial promt is displayed).
This was kind of annoying so I wrote a simple javascript routine to recreate and repopulate the field based on what was sent in object(:params).
I&#039;m sure I can&#039;t be the only one having this problem so if anyone needs any help with this then send me a mail and I&#039;ll be happy to explain how I solved it.
Thanks again for the tutorial.
Keep up the good work.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for the tutorial. I used this to great effect on the form I am designing for work.<br />
However, one major issue is that the dynamically created menus don&#8217;t survive a page refresh. That is, if you press submit, the form flags an error and thus re-renders itself (highlighting the errors) then the dynamically created menu vanishes (only the initial promt is displayed).<br />
This was kind of annoying so I wrote a simple javascript routine to recreate and repopulate the field based on what was sent in object(:params).<br />
I&#8217;m sure I can&#8217;t be the only one having this problem so if anyone needs any help with this then send me a mail and I&#8217;ll be happy to explain how I solved it.<br />
Thanks again for the tutorial.<br />
Keep up the good work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego</title>
		<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/comment-page-1/#comment-8298</link>
		<dc:creator>Diego</dc:creator>
		<pubDate>Fri, 06 Feb 2009 12:41:22 +0000</pubDate>
		<guid isPermaLink="false">http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/#comment-8298</guid>
		<description>You can use the &quot;options_for_select(collection_here)&quot; helper for create the option tags inside desired select tag without iterators or partial layouts. Use it directly like &quot;page.replace_html &#039;select_id&#039;, options_for_select(collection_here)&quot;.</description>
		<content:encoded><![CDATA[<p>You can use the &#8220;options_for_select(collection_here)&#8221; helper for create the option tags inside desired select tag without iterators or partial layouts. Use it directly like &#8220;page.replace_html &#8217;select_id&#8217;, options_for_select(collection_here)&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Teale</title>
		<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/comment-page-1/#comment-2834</link>
		<dc:creator>Adam Teale</dc:creator>
		<pubDate>Tue, 02 Sep 2008 08:00:31 +0000</pubDate>
		<guid isPermaLink="false">http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/#comment-2834</guid>
		<description>Thanks a lot Neal! Your tutorial has giving a far better understanding of observe_field and menus. I almost have it working (no errors in the terminal), but my 2nd menu refreshes with an empty list - no worries, i hopefully can work it out
Cheers!
Adam,
Bangkok</description>
		<content:encoded><![CDATA[<p>Thanks a lot Neal! Your tutorial has giving a far better understanding of observe_field and menus. I almost have it working (no errors in the terminal), but my 2nd menu refreshes with an empty list &#8211; no worries, i hopefully can work it out<br />
Cheers!<br />
Adam,<br />
Bangkok</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sara</title>
		<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/comment-page-1/#comment-2100</link>
		<dc:creator>Sara</dc:creator>
		<pubDate>Fri, 25 Apr 2008 03:41:05 +0000</pubDate>
		<guid isPermaLink="false">http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/#comment-2100</guid>
		<description>Hey, I got it to work!!  I had to change the following 2 things:

In the controller, changed the find method to say:

@cities = City.find_all_by_states_id(params[&#039;states_id&#039;])

and in the view, changed the observe_field statement to say:

:with =&gt; &quot;states_id&quot;,

It works!  Awesome!</description>
		<content:encoded><![CDATA[<p>Hey, I got it to work!!  I had to change the following 2 things:</p>
<p>In the controller, changed the find method to say:</p>
<p>@cities = City.find_all_by_states_id(params['states_id'])</p>
<p>and in the view, changed the observe_field statement to say:</p>
<p>:with =&gt; &#8220;states_id&#8221;,</p>
<p>It works!  Awesome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sara</title>
		<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/comment-page-1/#comment-2097</link>
		<dc:creator>Sara</dc:creator>
		<pubDate>Thu, 24 Apr 2008 23:04:46 +0000</pubDate>
		<guid isPermaLink="false">http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/#comment-2097</guid>
		<description>I can&#039;t get this to work either.  I am using Rails 2.0 -- does that matter?  

I am using Firefox 2.0.  When I click an option in the &quot;states&quot; list, nothing happens.  For some reason the &quot;cities&quot; dropdown will not populate.</description>
		<content:encoded><![CDATA[<p>I can&#8217;t get this to work either.  I am using Rails 2.0 &#8212; does that matter?  </p>
<p>I am using Firefox 2.0.  When I click an option in the &#8220;states&#8221; list, nothing happens.  For some reason the &#8220;cities&#8221; dropdown will not populate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Frugard</title>
		<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/comment-page-1/#comment-721</link>
		<dc:creator>Christian Frugard</dc:creator>
		<pubDate>Tue, 02 Oct 2007 19:33:44 +0000</pubDate>
		<guid isPermaLink="false">http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/#comment-721</guid>
		<description>I am using an :observe_field on a series of select elements. It is pretty successful. I think I have found a bug though. When I change the option in a select, the :with parameter is sent, the next element is updated, and everything is good. 

 Processing IpController#select_technology (for 0.0.0.0 at 
2007-09-2711:31:39) [POST]Session ID: 
c2e7072af4526b7b7a617e526e3d161bParameters: 
{&quot;ip_info_vw_ring_technology_key&quot;=&gt;&quot;1&quot;,&quot;action&quot;=&gt;&quot;select_technology&quot;, 
&quot;controller&quot;=&gt;&quot;ip&quot;} 


If I change the option in the first select again, quickly (2 seconds later), the action sent to the controller does not contain the :with parameter. 
Processing IpController#select_technology (for 0.0.0.0 at 
2007-09-2711:31:41) [POST]Session ID: 
c2e7072af4526b7b7a617e526e3d161bParameters: 
{&quot;action&quot;=&gt;&quot;select_technology&quot;, &quot;controller&quot;=&gt;&quot;ip&quot;} 


If I wait a little longer between changing options (6-7 seconds), 
it behaves correctly. Is this a bug anyone else has seen? 

Thanks for your help, 


Christian</description>
		<content:encoded><![CDATA[<p>I am using an <img src='http://nealenssle.com/blog/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> bserve_field on a series of select elements. It is pretty successful. I think I have found a bug though. When I change the option in a select, the :with parameter is sent, the next element is updated, and everything is good. </p>
<p> Processing IpController#select_technology (for 0.0.0.0 at<br />
2007-09-2711:31:39) [POST]Session ID:<br />
c2e7072af4526b7b7a617e526e3d161bParameters:<br />
{&#8220;ip_info_vw_ring_technology_key&#8221;=&gt;&#8221;1&#8243;,&#8221;action&#8221;=&gt;&#8221;select_technology&#8221;,<br />
&#8220;controller&#8221;=&gt;&#8221;ip&#8221;} </p>
<p>If I change the option in the first select again, quickly (2 seconds later), the action sent to the controller does not contain the :with parameter.<br />
Processing IpController#select_technology (for 0.0.0.0 at<br />
2007-09-2711:31:41) [POST]Session ID:<br />
c2e7072af4526b7b7a617e526e3d161bParameters:<br />
{&#8220;action&#8221;=&gt;&#8221;select_technology&#8221;, &#8220;controller&#8221;=&gt;&#8221;ip&#8221;} </p>
<p>If I wait a little longer between changing options (6-7 seconds),<br />
it behaves correctly. Is this a bug anyone else has seen? </p>
<p>Thanks for your help, </p>
<p>Christian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/comment-page-1/#comment-669</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 18 Sep 2007 02:27:26 +0000</pubDate>
		<guid isPermaLink="false">http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/#comment-669</guid>
		<description>This isn&#039;t working for me...

When I select an option from the first SELECT field, the second SELECT field just grays out. Any ideas?

Thanks.</description>
		<content:encoded><![CDATA[<p>This isn&#8217;t working for me&#8230;</p>
<p>When I select an option from the first SELECT field, the second SELECT field just grays out. Any ideas?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
