Some time ago I’ve got a really strange error message when trying to access a new method in a controller I have created for a rails application …
In the log the error message was:
“wrong number of arguments (2 for 0)”
the step by step to reproduce this error is:
What really happened?
ActionController has a method named process, and my controller:
class TestController < ApplicationController def process end end
defined a action with the same name, and it messed up with ActionPack …
Hasan had a very similar problem but with a reserved attribute of ActiveRecord
So, if you are having strange problems like these ones, try looking for a “reserved” attribute or method …
They are not really reserved, but, you have to pay attention when you redefine a “rails core” method ![]()
Even if you do not know that you are redefining the method
If you enjoyed this post, make sure you subscribe to my RSS feed!