Url_for missing out parameters?

Having a bit of an issue with url_for

The current page I’m on has a named route as follows:

map.some_page ‘page/:id/:range’, :action => ‘the_action’

All looks fairly normal. I have an url_for on this page to make a link
to another page as so:

url_for(:controller=>‘other’, :action=>‘display’, :id=>5,
:range=>‘the_range’)

This URL comes out as:

/other/display/5

You’ll note that the ‘range’ is missing.
Passing in anything else other than ‘range’ works fine.

IE:

url_for(:controller=>‘other’, :action=>‘display’, :id=>5,
:test=>‘something’, :range=>‘the_range’)

results in:

/other/display/5?test=something

Any ideas why it’s ignoring the ‘range’ param?

Removing the :range param on the named route for the current page (note,
not the page the url_for is pointing to) make it work, but then that
breaks the nice url in the current page!

I’m running edge on windows with ruby 1.8.2.

Thanks in advance.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs