On 1/19/07, why the lucky stiff <[EMAIL PROTECTED]> wrote: > On Fri, Jan 19, 2007 at 11:02:37AM -0700, James Earl wrote: > > Replying to myself... this works, instead of using yield. Not very > > pretty I know :) > > > > module Test > > require 'erb' > > def render(m) > > content=ERB.new(IO.read("templates/#{m}.html")).result(binding) > > layout=ERB.new(IO.read("templates/layout.html")).result(binding) > > end > > end > > Hey, nice tip. You want to add this to the wiki? A good place > would be CampingExtras[1]. > > _why
Thanks! It's added. Feel free to improve the code if necessary :) http://code.whytheluckystiff.net/camping/wiki/CampingAndErb _______________________________________________ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list