<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Lucid &#187; rjs</title>
	<atom:link href="http://thelucid.com/tag/rjs/feed/" rel="self" type="application/rss+xml" />
	<link>http://thelucid.com</link>
	<description>The Lightweight Ramblings of Jamie Hill</description>
	<lastBuildDate>Sun, 11 Mar 2012 19:52:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Rails Edge: Getting your view extensions ready for edge</title>
		<link>http://thelucid.com/2007/05/16/rails-edge-getting-your-view-extensions-ready-for-edge/</link>
		<comments>http://thelucid.com/2007/05/16/rails-edge-getting-your-view-extensions-ready-for-edge/#comments</comments>
		<pubDate>Wed, 16 May 2007 18:07:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[erb]]></category>
		<category><![CDATA[rjs]]></category>
		<category><![CDATA[views]]></category>

		<guid isPermaLink="false">http://0aa2ec8d-5d7f-4bce-9b6b-2b08a86c202e</guid>
		<description><![CDATA[Following my previous post, below is a modified version of &#8220;John Nunemaker&#8217;s &#8216;Renaming RHTML to ERB&#8217;&#8221;:http://railstips.org/2007/3/4/renaming-rhtml-to-erb to take into account the format in the extension, and handle &#8220;the RJS issues I was having&#8221;:http://www.thelucid.com/articles/2007/05/16/rails-edge-view-file-extention-functionality-has-changed. namespace 'views' do desc 'Renames all .rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder and .haml to .html.haml' task 'rename' [...]]]></description>
			<content:encoded><![CDATA[<p>Following my previous post, below is a modified version of &#8220;John Nunemaker&#8217;s &#8216;Renaming RHTML to ERB&#8217;&#8221;:http://railstips.org/2007/3/4/renaming-rhtml-to-erb to take into account the format in the extension, and handle &#8220;the RJS issues I was having&#8221;:http://www.thelucid.com/articles/2007/05/16/rails-edge-view-file-extention-functionality-has-changed.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">namespace <span style="color:#996600;">'views'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  desc <span style="color:#996600;">'Renames all .rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder and .haml to .html.haml'</span>
  task <span style="color:#996600;">'rename'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'app/views/**/[^_]*.rhtml'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">`svn mv #{file} #{file.gsub(/<span style="color:#000099;">\.</span>rhtml$/, '.html.erb')}`</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'app/views/**/[^_]*.rjs'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">`svn mv #{file} #{file.gsub(/<span style="color:#000099;">\.</span>rjs$/, '.js.rjs')}`</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'app/views/**/[^_]*.rxml'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">`svn mv #{file} #{file.gsub(/<span style="color:#000099;">\.</span>rxml$/, '.xml.builder')}`</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'app/views/**/[^_]*.haml'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">`svn mv #{file} #{file.gsub(/<span style="color:#000099;">\.</span>haml$/, '.html.haml')}`</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>h4. Update</p>
<p>Added haml conversion.</p>
]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/05/16/rails-edge-getting-your-view-extensions-ready-for-edge/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Rails Edge: View file extention functionality has changed</title>
		<link>http://thelucid.com/2007/05/16/rails-edge-view-file-extention-functionality-has-changed/</link>
		<comments>http://thelucid.com/2007/05/16/rails-edge-view-file-extention-functionality-has-changed/#comments</comments>
		<pubDate>Wed, 16 May 2007 17:19:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[rjs]]></category>
		<category><![CDATA[views]]></category>

		<guid isPermaLink="false">http://19c5d163-7843-420c-962c-cc2b117c8b13</guid>
		<description><![CDATA[It seems that on edge revision 6502 and later, the way that view file extensions has changed considerably. I couldn&#8217;t work out why my tests were breaking when doing an xhr request to a new action which had a respond_to block setup for both html and js. It was returning the html instead of the [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that on edge revision 6502 and later, the way that view file extensions has changed considerably.</p>
<p>I couldn&#8217;t work out why my tests were breaking when doing an xhr request to a <code>new</code> action which had a <code>respond_to</code> block setup for both html and js. It was returning the html instead of the rjs??</p>
<p>It turns out (after tearing my hair out for over three hours) that &#8220;Changeset 6499&#8243;:http://dev.rubyonrails.org/changeset/6499 changes things in such a way that the normal <code>new.rjs</code> naming will not get picked up on an xhr request, you now need to add the request format to the extension before the template type i.e. <code>new.js.rjs</code></p>
<p>This seemed a little odd at first but I am guessing it means you could have a <code>new.js.erb</code> file which is pretty cool as you could achieve the same as &#8220;Dan Webb&#8217;s MinusR plugin&#8221;:http://www.danwebb.net/2006/11/17/rjs-minus-r.</p>
<p>What does seem a little odd is that a <code>new.rjs</code> will get picked up if you don&#8217;t give a <code>respond_to</code> at-all (I don&#8217;t know if this is a &#8220;feature&#8221; or a bug).</p>
<p>I&#8217;m am hoping that this may save someone some time.</p>
]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/05/16/rails-edge-view-file-extention-functionality-has-changed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

