How do I call a controller from a model, console, or outside


I’m writing yet another cms and I need to capture the html output of a
rendered template including helpers, etc from within my rails app. I
plan to use backgroundrb, and I need to be able to capture the output of
“pages.browse()” where pages is my controller. I need to pass in the id

How can I do this besides using Net::HTTP? Using Net::HTTP hangs when
I’m testing using webrick.

I see that Actioncontroller::IntegrationTest can do this, but I have no
idea of how to call that from a development/production environment.


On Jul 31, 2006, at 1:08 PM, Jason E. wrote:
Hey Jason-

I think you can just use render_to_string to capture what you want.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs