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


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


=> “hello world”

Anybody has a good idea on how to do this?

Thank you,


don’t worry,

looks a piece of cake