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
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, …
Llama 2 avoids errors by staying quiet, GPT-4 gives long, if useless, samples
The article discusses a study conducted by computer scientists at the University of California San Diego on the reliability and robustness of large …
NoMethodError (undefined method `finder') with Engines and Rails 2.2
I was getting this error with Rails 2.2 when using ActionMailer.
NoMethodError (undefined method `finder’ for #ActionView::Base:0x34146fc)
It …
