<?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: Simple Live Validations in Rails</title>
	<atom:link href="http://dmix.ca/2009/07/simple-live-validations-in-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://dmix.ca/2009/07/simple-live-validations-in-rails/</link>
	<description>Toronto Start-ups, Ruby on Rails, User Experience &#38; Marketing</description>
	<lastBuildDate>Wed, 08 Sep 2010 08:45:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Christoph Olszowka</title>
		<link>http://dmix.ca/2009/07/simple-live-validations-in-rails/comment-page-1/#comment-320</link>
		<dc:creator>Christoph Olszowka</dc:creator>
		<pubDate>Sun, 12 Jul 2009 11:24:34 +0000</pubDate>
		<guid isPermaLink="false">http://dmix.ca/?p=248#comment-320</guid>
		<description>@Dan: Oh yeah, you&#039;re right - I mixed that up with periodically_call_remote!</description>
		<content:encoded><![CDATA[<p>@Dan: Oh yeah, you&#8217;re right &#8211; I mixed that up with periodically_call_remote!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan McGrady</title>
		<link>http://dmix.ca/2009/07/simple-live-validations-in-rails/comment-page-1/#comment-309</link>
		<dc:creator>Dan McGrady</dc:creator>
		<pubDate>Sat, 11 Jul 2009 14:20:32 +0000</pubDate>
		<guid isPermaLink="false">http://dmix.ca/?p=248#comment-309</guid>
		<description>@BrianTheCoder: I definitely plan on refactoring it to minimize the amount of data that rails is returning and let Javascript handle the rest. 

@Oliver: thanks, we actually used something similar in another method (User.new = valid?), for demonstration I chose the simplest one. The JSON response looks clean.

@Christoph Olszowka: keep in mind it only sends requests if something is typed. If 50 users are on the page, only a fraction of the time is spent typing the username. Although 500 users is another story and would definitely benefit from the refactoring mentioned above.</description>
		<content:encoded><![CDATA[<p>@BrianTheCoder: I definitely plan on refactoring it to minimize the amount of data that rails is returning and let Javascript handle the rest. </p>
<p>@Oliver: thanks, we actually used something similar in another method (User.new = valid?), for demonstration I chose the simplest one. The JSON response looks clean.</p>
<p>@Christoph Olszowka: keep in mind it only sends requests if something is typed. If 50 users are on the page, only a fraction of the time is spent typing the username. Although 500 users is another story and would definitely benefit from the refactoring mentioned above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christoph Olszowka</title>
		<link>http://dmix.ca/2009/07/simple-live-validations-in-rails/comment-page-1/#comment-307</link>
		<dc:creator>Christoph Olszowka</dc:creator>
		<pubDate>Sat, 11 Jul 2009 13:52:28 +0000</pubDate>
		<guid isPermaLink="false">http://dmix.ca/?p=248#comment-307</guid>
		<description>So this will flood your server with 2 ajax requests per form field per user - say you&#039;ve got 50 users on the signup form you&#039;ll have 300 ajax calls per second, even when the users just have the page open and aren&#039;t doing anything. You really should switch that to some on-change-only JS behaviour. I&#039;d use onblur here, which will trigger when the form field is left. Also, I don&#039;t see the point in using a partial for rendering plain text here. I&#039;d switch that to render :text =&gt; @message. I&#039;d also make use of :status =&gt; 2XX and 4XX and let the JS handle the icon and text color stuff.</description>
		<content:encoded><![CDATA[<p>So this will flood your server with 2 ajax requests per form field per user &#8211; say you&#8217;ve got 50 users on the signup form you&#8217;ll have 300 ajax calls per second, even when the users just have the page open and aren&#8217;t doing anything. You really should switch that to some on-change-only JS behaviour. I&#8217;d use onblur here, which will trigger when the form field is left. Also, I don&#8217;t see the point in using a partial for rendering plain text here. I&#8217;d switch that to render :text =&gt; @message. I&#8217;d also make use of :status =&gt; 2XX and 4XX and let the JS handle the icon and text color stuff.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver</title>
		<link>http://dmix.ca/2009/07/simple-live-validations-in-rails/comment-page-1/#comment-306</link>
		<dc:creator>Oliver</dc:creator>
		<pubDate>Sat, 11 Jul 2009 13:41:34 +0000</pubDate>
		<guid isPermaLink="false">http://dmix.ca/?p=248#comment-306</guid>
		<description>Doh, the pastie didn&#039;t get included, just follow this link http://pastie.org/542319</description>
		<content:encoded><![CDATA[<p>Doh, the pastie didn&#8217;t get included, just follow this link <a href="http://pastie.org/542319" rel="nofollow">http://pastie.org/542319</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver</title>
		<link>http://dmix.ca/2009/07/simple-live-validations-in-rails/comment-page-1/#comment-305</link>
		<dc:creator>Oliver</dc:creator>
		<pubDate>Sat, 11 Jul 2009 13:40:39 +0000</pubDate>
		<guid isPermaLink="false">http://dmix.ca/?p=248#comment-305</guid>
		<description>I too wanted to have some live validation in my rails app, I didn&#039;t want to duplicate the validation definitions on the client side, instead I wrote a controller method that would validate a form, and respond with either a success or failure, as well as all validation error messages.



This can then get called as frequently as you like when the user types etc.  I&#039;m sure it could probably be made quicker with metal, and using some magic be able to handle any models, but for now it works.</description>
		<content:encoded><![CDATA[<p>I too wanted to have some live validation in my rails app, I didn&#8217;t want to duplicate the validation definitions on the client side, instead I wrote a controller method that would validate a form, and respond with either a success or failure, as well as all validation error messages.</p>
<p>This can then get called as frequently as you like when the user types etc.  I&#8217;m sure it could probably be made quicker with metal, and using some magic be able to handle any models, but for now it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BrianTheCoder</title>
		<link>http://dmix.ca/2009/07/simple-live-validations-in-rails/comment-page-1/#comment-294</link>
		<dc:creator>BrianTheCoder</dc:creator>
		<pubDate>Fri, 10 Jul 2009 20:06:35 +0000</pubDate>
		<guid isPermaLink="false">http://dmix.ca/?p=248#comment-294</guid>
		<description>Why not just return true or false and have javascript handle the rest? For ajax calls its usually best to have rails do as little as possible to make it fast.</description>
		<content:encoded><![CDATA[<p>Why not just return true or false and have javascript handle the rest? For ajax calls its usually best to have rails do as little as possible to make it fast.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
