At 02:36 -0800 1/7/09, Yehuda Katz wrote:
> You need to use BlockAwareEruby, not standard Eruby.  That
> should solve your problem.

I changed process_eruby(), as follows:

    def process_eruby(text)
      trc('er_0', text) #T
  #   erb  = Erubis::Eruby.new(text)
      erb  = Erubis::BlockAwareEruby.new(text)
      text = erb.result(binding())
    end

This allowed the Test_2 page to render without crashing, but
the content is getting lost for some reason.  I put a trace
on @text, getting:

  @text="Test 2 Start...\n\n\n<p><pre>\n\n</pre>\n\nTest 2 End...\n"


Looking at the way Merb uses compile_template (etc), I can see that
there's a bit of trickiness going on.  However, I'm not able to see
how to do equivalent things in my own code (engines and templates
and locals; oh my!).  Can you provide me with an incantation?


> Out of curiosity, why are you trying to process it directly
> in the controller?

The larger context here is that I'm creating a wiki which allows
executable Ruby code to be stored in pages, then run to generate
"report" pages, etc.  So, in practice, the show() method will get
the contents of one or more wiki pages from CouchDB, render them,
and pas the results on to a view for final processing.

I have some screenshots up at:

  http://cfcl.com/twiki/bin/view/MBW/MobiExamples

Here are some other pages which try to explain the approach:

  http://cfcl.com/twiki/bin/view/MBW/Mobi
  http://cfcl.com/twiki/bin/view/MBW/MobiArchitecture
  http://cfcl.com/twiki/bin/view/MBW/MobiSecurity

-r
-- 
http://www.cfcl.com/rdm            Rich Morin
http://www.cfcl.com/rdm/resume     [email protected]
http://www.cfcl.com/rdm/weblog     +1 650-873-7841

Technical editing and writing, programming, and web development

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to