Forum: Ruby on Rails url_for - results inconsistency ??

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
l00pek (Guest)
on 2006-04-11 13:46
Hi all,

I recently noticed something really weird in url_for results
let's say that we have something like this somewhere in code
<pre>
URL1:<%=url_for( {:action=>'foobar'}.merge({'action'=>'ohmy'}) )%>
URL2:<%=url_for( {'action'=>'ohmy'}.merge({:action=>'foobar'}) )%>
</pre>

and then please consider following two cases...

case 1. webrick, ruby 1.8.4, rails 1.0
result:
URL1:.../foobar
URL2:.../foobar

case 2: lighttpd-1.4.11, ruby 1.8.4, rails 1.0
result:
URL1:.../ohmy
URL2:.../ohmy

What is the cause of such behavior, and is there any way to avoid this
kind of inconsistency ?
Can this be treated as a bug ?

--l00pek
This topic is locked and can not be replied to.