[Rails] Re: How can a rails app get its host name?

2009-11-25 Thread INDRANIL MUKHERJEE
check database.yml file in config directory On Nov 20, 12:55 am, explainer wrote: > I would like my Rails app to supply a callback url to another app.  I > currently have a yaml file in the config folder in which I put the > host name, but I would like to be able to query that dynamically and > d

Re: [Rails] Re: How can a rails app get its host name?

2009-11-24 Thread tommy xiao
request.host_with_port() in rails 2.3.4 api 2009/11/20 shweta > Try request.env['HTTP_HOST'] in the controller. > > -- > > 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-t...@googlegroup

[Rails] Re: How can a rails app get its host name?

2009-11-23 Thread shweta
Try request.env['HTTP_HOST'] in the controller. -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubs

[Rails] Re: How can a rails app get its host name?

2009-11-21 Thread Eric
An example that has caused me to have to use a config.yml, ActionMailer will not have request.* available. System calls would not work in this case either, since they would return a bad value on vhosts or in cases where the hostname is different than request.host. -eric On Nov 19, 11:57 am, Frede

[Rails] Re: How can a rails app get its host name?

2009-11-21 Thread sami
request.env["SERVER_ADDR"] // this will return you server ip address request.server_name or request.host // this will return host name On Nov 20, 1:55 am, explainer wrote: > I would like my Rails app to supply a callback url to another app.  I > currently have a yaml file in the config folder i

[Rails] Re: How can a rails app get its host name?

2009-11-20 Thread candlerb
To find what the machine thinks its own name is (which may or may not be related to the hostname you want in a callback url), try: Socket.gethostname As has been pointed out, the callback url also needs things like the port. If you are generating this within a controller action, you could of co

[Rails] Re: How can a rails app get its host name?

2009-11-20 Thread Scott Johnson
That assumes you are on the default port (80). On Nov 19, 3:47 pm, Norm Scherer wrote: > explainer wrote:I would like my Rails app to supply a callback url to another > app. I currently have a yaml file in the config folder in which I put the > host name, but I would like to be able to query th

[Rails] Re: How can a rails app get its host name?

2009-11-19 Thread icke
request.host -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more op

[Rails] Re: How can a rails app get its host name?

2009-11-19 Thread Frederick Cheung
On Nov 19, 7:55 pm, explainer wrote: > I would like my Rails app to supply a callback url to another app.  I > currently have a yaml file in the config folder in which I put the > host name, but I would like to be able to query that dynamically and > do away with the yaml file.  Is there a metho