Forum: Ruby on Rails File path from controller

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6cc6aad994baecbe0dd4ee62e598dee7?d=identicon&s=25 Jon Glick (jonathanpg)
on 2007-07-26 20:13
I'm trying to load an .html file from my /public directory using Hpricot
in one of my controllers.

Ex: doc = Hpricot(open('/template_1.htm'))

This can't seem to find the file and it only works if I use the full,
absolute url which is unacceptable since there will be many different
sub-domains.  How can I correctly reference a file in the /public
directory?  Is there some type of root constant I can prepend to this?
This topic is locked and can not be replied to.