Is there something similar for rails that is like $_SERVER in PHP? Something that gives you the hostname, etc. I tried using just host in my controller, because the documentation says there is a host method, and got an undefined method error. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Is there something similar for rails that is like $_SERVER in PHP? > Something that gives you the hostname, etc. I tried using just host in > my controller, because the documentation says there is a host method, > and got an undefined method error.Try request.host See http://api.rubyonrails.com/classes/ActionController/AbstractRequest.html Regards, Rimantas -- http://rimantas.com/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 31-Aug-06, at 9:51 AM, Ben Johnson wrote:> Is there something similar for rails that is like $_SERVER in PHP? > Something that gives you the hostname, etc. I tried using just host in > my controller, because the documentation says there is a host method, > and got an undefined method error.The request object responds to ''host'' and others. Try this in your controller: request.host See here for more: http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html /Jeff -- http://re.visioni.st http://quotedprintable.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---