Polymathic Blog
Digital transformation, higher education, innovation, technology, professional skills, management, and strategy
1 min read
ruby-on-rails

Place Custom Rails Routes First

This is another one that should have been obvious. But, I was getting it wrong. Maybe it had something to do with upgrading to Rails 1.2.6.

Anyway, I was getting an error with a custom action. I was sending a form to “projects/do_something”. But, I kept getting the error of “Can’t find project with ID=do_something”.

This was happening because Rails thought it was supposed to be looking in the route for the show action. But, checking the routes file, I could see that I had defined my custom route. What, what was up?

It turns out, the custom route has to come before the standard “map.resources :projects” line.

Once I fixed that, all is well again. (I still think this acted differently in 1.2.3. Hmm).

Related Posts

30 Jan 2024

Google Criticized for Privacy Issues

Ian ‘Hixie’ Hickson, a prominent figure in the Flutter community, has left Google. Despite not being as public as other contributors, …