Render Variable?

Hi All,
             I have a string variable that contains other ruby
variables. I intend to render the string variable and replace the
other ruby variables in it with their values.Is it possible?

To clarify my question, here is the same :-

@ruby_variable = "Some value in the variable"

@variable_to_be_rendered = "Some text @ruby_variable"

After rendering(if thats possible, or some other function), I would
get the value

"Some text Some value in the variable"

Regards,
Mohit

yes, you can use erb for that

http://www.ruby-doc.org/core/classes/ERB.html

@variable_to_be_rendered = "Some text @ruby_variable"

would have to look like:

@variable_to_be_rendered = "Some text <%= @ruby_variable %>"

to do that

Cool! It works like a charm :-).

Is there any thing similar in rails, rather than ruby?

@var1 = “Hello”
@var2 = “World #{@var1}”