How to find the base URI address of a Rails site?


Suppose I have a site hosted by a real web server, such as Apache, and
it doesn’t put the site on http://server/. Suppose it puts the site
down in http://server/path/path/path/.

If I call url_for(‘/’) it just passes that thru. (Parenthetically:
Why? What’s the point?)

I need to get the complete path that the server uses to dispatch to
the base of the Rails site. Where is this crumb of data?

Phlip ← NOT a blog!! ? I think that’d work if I understand your question


Okay. Disregard my last post. I was rereading this and realized I posted
exact wrong answer. Sorry.


Russell N. wrote:

Okay. Disregard my last post.

Yeah! You could’a found it in one Google hit:

The first citation yields

def image_path(source)
compute_public_path(source, ‘images’, ‘png’)

And compute_public_path is wisely private, so I can’t abuse it. Yet it
contains this:


And now the answer is documented. (-;


Heh. I love your attitude. Make fun of me for not Googling when you
Google yourself. Sorry I tried to help.