Re: Rendering with erb

2007-01-19 Thread James Earl
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(I

Re: Rendering with erb

2007-01-19 Thread why the lucky stiff
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.rea

Re: Rendering with erb

2007-01-19 Thread Manfred Stienstra
On Jan 19, 2007, at 7:02 PM, James Earl wrote: > Replying to myself... this works, instead of using yield. Not very > pretty I know :) Cool, you figured it out yourself! ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mail

Re: Rendering with erb

2007-01-19 Thread James Earl
On 1/19/07, James Earl <[EMAIL PROTECTED]> wrote: > Hi, I thought it would be fun to try to write a render method that > uses erb for rending. I'm not much of a programmer, but I still like > to try: > > module Test > require 'erb' > def render(m) > ERB.new(IO.read("templates/layout.html")

Rendering with erb

2007-01-19 Thread James Earl
Hi, I thought it would be fun to try to write a render method that uses erb for rending. I'm not much of a programmer, but I still like to try: module Test require 'erb' def render(m) ERB.new(IO.read("templates/layout.html")).result(binding) do ERB.new(IO.read("templates/#{m}.html")