The problem is that :requirements only applies if that
param exists. I’d like to make it so that that route
only applies if all params do in fact exist. I’d do it
with redirects in Lighty, but I want to send 301
redirects and I’m not sure what code redirect.url
sends (probably 302).
Thanks for any help!
csn
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
redirects and I’m not sure what code redirect.url
sends (probably 302).
Thanks for any help!
csn
This might be a crazy hack, but what happens if you change the route to
be:
map.connect ‘items/:subject/:id’, :id => ‘crazy’,
:controller=>‘items’, :action=>‘show_redirect’,
:requirements => {:subject => /.+/, :id => /\d+/}
The idea being that :id defaults to a value that doesn’t match the
requirements.
Totally untested, may not work, etc.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.