Ramaze Partials with Etanni

Innate/Ramaze Version: 2009-10
Template Engine: Etanni

The title of this blog post is a little inaccurate as what I’m actually going to describe are Etanni partials but considering Etanni is the default template engine in Innate/Ramaze 2009-10 I figured “Ramaze Partials” was a fair generalization.

Etanni partials are easy to work with and as Pistos points out below they are documented in the rdocs. 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 “render helper” in the blogosphere. My hope is that this post will make it easier to find this information.

The Render Helper

This render helper can be found in the Innate code base – it is clearly commented and worth a look if you’ve got a few minutes. There are 3 methods that this helper provides to aid you in the creation of your partials:

  1. render_partial
  2. render_view
  3. render_file

I will only cover render_partial as it is the only one that I’ve needed to use thus far.

render_partial

render_partial(action_name, variables = {})

The action_name parameter references a controller method and the variables parameter is a hash which is turned into members which are locally accessible within that method. Note that action_name doesn’t have to actually have a method declaration within a controller – it can simply be the name of a view.

Example

Here is the example code for a rendering contact information via an Etanni partial:

View Comments to “Ramaze Partials with Etanni”

  1. Max RB says:

    Thanks for the links Pistos, I didn't see those when I went looking for info on Google – checking the rdocs would've been a good idea :) . I'll update the post to include this info.

  2. Max RB says:

    Thanks for the links Pistos, I didn't see those when I went looking for info on Google – checking the rdocs would've been a good idea :) . I'll update the post to include this info.

Leave a Reply

Some HTML is OK

blog comments powered by Disqus