<?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>YAB &#187; rjs</title>
	<atom:link href="http://blog.alexgirard.com/tag/rjs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexgirard.com</link>
	<description>Yet Another Blog</description>
	<pubDate>Sat, 15 Nov 2008 01:14:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Using RJS templates</title>
		<link>http://blog.alexgirard.com/using-rjs-templates/</link>
		<comments>http://blog.alexgirard.com/using-rjs-templates/#comments</comments>
		<pubDate>Thu, 04 Jan 2007 17:20:14 +0000</pubDate>
		<dc:creator>alx</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[coding]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[dom]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[rjs]]></category>

		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://blog.alexgirard.com/?p=25</guid>
		<description><![CDATA[Ruby on Rails is a great platform to work with, there is so much niceties for geeks like me. Today has been a great day to work with RJS templates.
You must use RJS templates, just because when you don&#8217;t know where to put the view behavior after an action, and because filling a link_to_remote helper [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby on Rails is a great platform to work with, there is so much niceties for geeks like me. Today has been a great day to work with RJS templates.<br/><br />
You must use RJS templates, just because when you don&#8217;t know where to put the view behavior after an action, and because filling a link_to_remote helper with too much parameters is really ugly.<br/></p>
<h3>Changing DOM className</h3>
<p>Because my application needs to display some dynamic user selection of an avatar, a great way has been to change the CSS className of the selected avatar.<br/><br />
Here is how to do it with RJS:</p>
<pre class="prettyprint">
page.select(".avatar").all() do |element, index|
  page.call 'Element.removeClassName', element, 'selected_avatar'
end

page.call 'Element.addClassName', @avatar, 'selected_avatar'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexgirard.com/using-rjs-templates/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
