From: Brian Candler Date: 2010-12-09T00:34:21+09:00 Subject: Re: How to delay "string" interpretation? Fritz Trapper wrote in post #966837: > Suppose the following code: > > t='#{a} + #{b}' > ... > a='a';b='b' > > How to cause ruby to interpret t as a "string" to get the result string > "a + b"? Here's one option: require 'erb' t = '<%= a %> + <%= b %>' template = ERB.new(t) a = 'foo' b = 'bar' puts template.result(binding) erb is in the standard library. Erubis is an alternative implementation, faster and more powerful, and really well documented. -- Posted via http://www.ruby-forum.com/.