<?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>xambr::blog &#187; etanni</title>
	<atom:link href="http://blog.xambr.com/tag/etanni/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xambr.com</link>
	<description>crafting my thoughts</description>
	<lastBuildDate>Tue, 20 Jul 2010 18:57:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Ramaze Partials with Etanni</title>
		<link>http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/</link>
		<comments>http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 06:14:32 +0000</pubDate>
		<dc:creator>max.rb</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[etanni]]></category>
		<category><![CDATA[ramaze]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.xambr.com/?p=176</guid>
		<description><![CDATA[Innate/Ramaze Version: 2009-10 Template Engine: Etanni The title of this blog post is a little inaccurate as what I&#8217;m actually going to describe are Etanni partials but considering Etanni is the default template engine in Innate/Ramaze 2009-10 I figured &#8220;Ramaze Partials&#8221; was a fair generalization. Etanni partials are easy to work with and as Pistos [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Innate/Ramaze Version:</strong> 2009-10<br />
<strong>Template Engine:</strong> Etanni</p>
<p>The title of this blog post is a little inaccurate as what I&#8217;m actually going to describe are Etanni partials but considering Etanni is the default template engine in Innate/Ramaze 2009-10 I figured &#8220;Ramaze Partials&#8221; was a fair generalization.</p>
<p>Etanni partials are easy to work with and as Pistos points out below they are documented in the <a href="http://doc.rubyists.com/ramaze+innate/Innate/Helper/Render.html#render_partial-instance_method">rdocs</a>. That said, when I went about looking for info on them (using Google) I missed the rdocs and could only find brief mentions of a &#8220;render helper&#8221; in the blogosphere. My hope is that this post will make it easier to find this information.</p>
<h2>The Render Helper</h2>
<p>This <a href="http://github.com/manveru/innate/blob/master/lib/innate/helper/render.rb" target="_blank">render helper</a> can be found in the <a href="http://github.com/manveru/innate">Innate code base</a> &#8211; it is clearly commented and worth a look if you&#8217;ve got a few minutes. There are 3 methods that this helper provides to aid you in the creation of your partials:</p>
<ol>
<li><span style="font-family: monospace; ">render_partial</span></li>
<li><span style="font-family: monospace;">render_view</span></li>
<li><span style="font-family: monospace;">render_file</span></li>
</ol>
<p>I will only cover <code>render_partial</code> as it is the only one that I&#8217;ve needed to use thus far.</p>
<h2>render_partial</h2>
<p><code>render_partial(action_name, variables = {})</code></p>
<p>The <code>action_name</code> parameter references a controller method and the <code>variables</code> parameter is a hash which is turned into members which are locally accessible within that method. Note that <code>action_name</code> doesn&#8217;t have to actually have a method declaration within a controller &#8211; it can simply be the name of a view.</p>
<h3>Example</h3>
<p>Here is the example code for a rendering contact information via an Etanni partial:</p>
<p><script src="http://gist.github.com/243258.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xambr.com/2009/11/26/ramaze-partials-with-etanni/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
