<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>novolocus.com &#187; 2005 &#187; December &#187; 13</title>
	<atom:link href="http://www.novolocus.com/2005/12/13/feed" rel="self" type="application/rss+xml" />
	<link>http://www.novolocus.com</link>
	<description>Whatever Andy Burns is working on...</description>
	<pubDate>Tue, 18 Nov 2008 12:00:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Impressed with Rails - again</title>
		<link>http://www.novolocus.com/2005/12/13/impressed-with-rails-again/</link>
		<comments>http://www.novolocus.com/2005/12/13/impressed-with-rails-again/#comments</comments>
		<pubDate>Tue, 13 Dec 2005 23:12:13 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
		
		<category><![CDATA[Ruby &amp; Rails]]></category>

		<guid isPermaLink="false">http://www.novolocus.com/?p=213</guid>
		<description><![CDATA[So, I had need of a little &#8216;Ajax&#8217;. I wanted to provide a brief preview of some content, but without all the nastiness of page refreshes - an ideal candidate for XMLHTTPRequest. So I wrote my own. That was a mistake.
I&#8217;m comfortable with Javascript - I think I&#8217;m fairly accomplished with it - so I [...]]]></description>
			<content:encoded><![CDATA[<p>So, I had need of a little &#8216;Ajax&#8217;. I wanted to provide a brief preview of some content, but without all the nastiness of page refreshes - an ideal candidate for XMLHTTPRequest. So I wrote my own. That was a mistake.</p>
<p>I&#8217;m comfortable with Javascript - I think I&#8217;m fairly accomplished with it - so I got it done, and it worked. It was only then that I thought &#8216;I think Rails does Ajax too&#8217;. Does it ever! Ten minutes, and I had a Rails Ajax version working (a lot less than my own time, even with my boiler-plate code) and, and this is the best bit, much more readable code! That&#8217;s what I call a win. <a href="http://rails.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html#M000433">link_to_remote</a> was the useful function in question, and my call is:<br />
<code>link_to_remote( 	"Show",<br />
     :url =&gt; { :action =&gt; "show_small", :id =&gt; game.id },<br />
     :update =&gt; "js_board",<br />
     :before =&gt; "document.getElementById('js_board').style.left = get_x(this);<br />
          document.getElementById('js_board').style.top = get_y(this)",<br />
     :complete =&gt; "document.getElementById('js_board').style.visibility = 'visible'" )</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.novolocus.com/2005/12/13/impressed-with-rails-again/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
