This may be really obvious, but in rails how can I get the contents of a page without making an HTTP request?
i.e. I want to grab the contents of any page that my rails app generates, in a script on the same server. This is of course trivial with an HTTP request, but how can I get the contents of a page otherwise?
This is what I am doing now which works fine:
require 'open-uri'
contents = open("http://localhost/path_to_my_page").read # but I really want to get rid of the overhead of the HTTP request
I need to be able to do this from a script, within the rails app, not a controller (e.g. with render_to_string)