buildr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tal Rotbart" <redbe...@gmail.com>
Subject Re: Using ERB in Docter documents
Date Mon, 29 Sep 2008 02:18:22 GMT
Hi Juliano,

You might want to look again in the RDocs for ERB:
http://ruby-doc.org/core/classes/ERB.html
Search for the title "Ruby in HTML" which demonstrates one of the
options for passing more than one argument to the template.

You can also use OpenStruct to generate a binding object from a Hash.

Cheers,
Tal

On Sun, Sep 28, 2008 at 1:56 PM, Juliano DeCarvalho
<juliano.decarvalho@gmail.com> wrote:
> Hello,
>
> I'm currently working on a Buildr plugin which uses Docter to generate some
> files.  With my somewhat limited knowledge of Ruby, I have not been able to
> figure out how to pass the ERB templating system my own set of values (a
> binding object).  Can someone tell me if its possible to pass the textile
> files an object which I can then access in the templates themselves?
>
> I noticed that the common.erb_this() method takes a binding object, but have
> not been able to figure out how to use this to my adavantage.  Any help is
> apreciated.
>
> Thank you,
>
> - Juliano DeCarvalho
>

Mime
View raw message