render a page to a file with rails
I have a background process that loads a Rails 3.0 environment. I would like to have that process refresh cached pages instead of having to wait for them to be loaded the first time. How could I take a set of开发者_开发知识库 params
push it through the render pipeline to the point where I could direct the plain html to a file?
Rails 3.0 is a Rack Application. You can use a Rack Middleware to do it. Take a look a Rack::Deflater::GzipStream for a code sample and Rails on Rack for the RoR specific parts.
精彩评论