1

I have a named route:

map.find '/find/:category/:state/:search_term/:permalink', :search_term=>nil, :controller=>'find', :action=>'show_match'

and the following URL matches it & works OK:

http://localhost:3000/find/cars/ca/TestSeachTerm/bumpedupphoto-test

but if I take out the 2nd last parameter i.e. "TestSearchTerm", then the route fails to get matched, even though I have :search_term=>nil in the route.

http://localhost:3000/find/cars/ca//bumpedupphoto-test

Can anyone see what I am doing wrong? Being trying to solve this for a few days now.

Thanks!

Jason
  • 22,645
  • 5
  • 29
  • 51

1 Answers1

1

Add this after your current route:

map.find '/find/:category/:state/:permalink', :controller=>'find', :action=>'show_match'
Zepplock
  • 28,655
  • 4
  • 35
  • 50
  • Thanks for that. When I put that in as a route, rails cannot seem to decide which route to use: You have a nil object when you didn't expect it! The error occurred while evaluating nil.has_key? – Jason May 04 '10 at 18:35