url_for problem in rails
Last week I had a little problem in which sometimes, i.e. only in certain environments, I would get a double-slash in my urls when using url_for, or redirect_to in my rails controllers. In this case, it was Rails 2.1 (already frozen), and it wouldn't happen on the local box or on the company development box, but only on the client's test box. For example: inside foo_controller.rb:
url_for :action => 'bar'
would result in
http://example.com//foo/bar
instead of the desired
http://example.com/foo/bar
A fix for it was to use
url_for :controller => '/foo', :action => 'bar'
but this is not DRY, so I would still like to know what the actual problem is. In this case, when I say "url_for", I was actually using "redirect_to", but that's the resulting function.
