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,

This URL comes out as:


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


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

results in:


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