Railsters: 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 http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Russell Norris
2007-Mar-29 17:38 UTC
Re: How to find the base URI address of a Rails site?
request.host ? I think that''d work if I understand your question correctly. RSL On 3/28/07, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Railsters: > > 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 > http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Russell Norris
2007-Mar-29 17:38 UTC
Re: How to find the base URI address of a Rails site?
Okay. Disregard my last post. I was rereading this and realized I posted the exact _wrong_ answer. Sorry. RSL On 3/28/07, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Railsters: > > 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 > http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Russell Norris wrote:> Okay. Disregard my last post.Yeah! You could''a found it in one Google hit: http://www.google.com/codesearch?q=lang%3Aruby+image_path 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: @request.relative_url_root And now the answer is documented. (-; -- Phlip --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Russell Norris
2007-Mar-30 12:23 UTC
Re: How to find the base URI address of a Rails site?
Heh. I love your attitude. Make fun of me for not Googling when you didn''t Google yourself. Sorry I tried to help. RSL On 3/29/07, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Russell Norris wrote: > > > Okay. Disregard my last post. > > Yeah! You could''a found it in one Google hit: > > http://www.google.com/codesearch?q=lang%3Aruby+image_path > > 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: > > @request.relative_url_root > > And now the answer is documented. (-; > > -- > Phlip > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---