I’m stumped trying to generate an URL for a working route. I’ve this
route definition:
map.connect ‘foo/:foo_id/propose_something/:zap_id’,
:controller => “foo”,
:action => “propose_something”
When I browse to this url:
http://localhost:3000/foo/2/propose_something/5,
my propose_something method gets invoked with the correct params
hash. So one would think that all is good, but I’m stuck trying to
generate the corresponding URL to pass to link_to.
I would think that this would do it:
url_for(:controller => “foo”, :action => ‘propose_something’, :foo_id
=> 1, :zap_id => 13)
But this generates this URL:
http://localhost:3000/foo/propose_something?foo_id=1&zap_id=13
To work around this, I’ve constructed the string manually, but that
feels nasty in all sorts of ways…
Can someone point out what the heck I’m doing wrong?
Thanks,
east