views:

34

answers:

1

Hi,

When calling the _url helper in rails it will return host+port+path so for example

photo_url

will return

http://localhost:3000/photo

In my production environment I have thin serving the rails application on a given port and apache serving static content on another port. When the site is accesed without any port each server knows wich part to handle and everything is fine. However if a specific port is given, only the requested server sends a response (which is expected).

I'm now running into troubles, because when I authenticate a user via oauth2 (facebook, twitter) oder openid I need to send an callback url. The gem I use (OmniAuth) uses the _url helper (as far as I can tell) (callback_url) to calculate the callback url. Which results in only thin responding to further requests because of the appended port number.

Is there a way to tell rails, that it is not running on any specific port? Or that it does not use the portnumber in the _url helper?

A: 

Can you use photo_path instead?

jordinl
I would need to change the gem for that, which would not be a nice solution. (The behaviour of the gem is correct, it's my setup that's strange)
Peter