How to parse a .erb string and store the result on another string

Hi

Before diving on the seas of find-out-your-self

I though I’d venture a post.

given a string with valid .erb syntax such as

string=‘<% who=world %> hello <%= who %>’

is there a way to parse it and obtain the result?

something like the imaginary method parse_erb

string.parse_erb

=> “hello world”

Anybody has a good idea on how to do this?

Thank you,

Andres

don’t worry,

looks a piece of cake

http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html