Hey all, What''s the preferred method of rendering a view to a file? Basically I''d like to create a script that invokes an instance of my rails app and then renders the view to a file. I''d prefer to do this without an HTTP request (curl or whatever). Thanks in advance! Tim
Hi Tim, Tim McIntyre wrote:> What''s the preferred method of rendering a view to a file?Take a look at render_to_string. Renders your view to a string (rather than to a response to the browser) which can then be written to a file. hth, Bill
Reasonably Related Threads
- render_to_string in an after filter
- how do I render a partial view into a string from inside a view ?
- instance variables in templates
- rendering a partial inside another using render_to_string and (:formats) in controller
- Can I send rendered .html to somewhere besides the web server?