On Apr 10, 2006, at 12:22 AM, Oliver Andrich wrote:
> Paul Battley wrote:
>> URI.join("http://test.de/test1", "test2").to_s #=>
>> "http://test.de/test2"
>
> Can you explain to me why this is correct? I would expect
> http://test.de/test1/test2 as the result of your call.

Think of it this way --

You are in your web-browser on http://test.de/test1. There is a link  
to "test2":

	test2

Would you expect it to go to http://test.de/test1/test2? No, it would  
go to http://test.de/test2.

You want:

URI.join("http://test.de/test1/", "test2")
                               ^
URI.join("http://test.de/", "test1/", "test2")
                                   ^

-- Daniel