Forum: Ruby on Rails How to find the base URI address of a Rails site?

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.
Phlip (Guest)
on 2007-03-29 00:08
(Received via mailing list)

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!!
Russell N. (Guest)
on 2007-03-29 21:38
(Received via mailing list) ? I think that'd work if I understand your question

Russell N. (Guest)
on 2007-03-29 21:41
(Received via mailing list)
Okay. Disregard my last post. I was rereading this and realized I posted
exact _wrong_ answer. Sorry.

Phlip (Guest)
on 2007-03-30 06:11
(Received via mailing list)
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. (-;

Russell N. (Guest)
on 2007-03-30 16:24
(Received via mailing list)
Heh. I love your attitude. Make fun of me for not Googling when you
Google yourself. Sorry I tried to help.

This topic is locked and can not be replied to.