This project is archived and is in readonly mode.
method_missing in controller should receive symbol instead of string
Reported by Dmitry V | April 19th, 2009 @ 03:12 PM | in 3.0.2
class ApplicationController
def method_missing(method, *args)
if something
# ...
else
super
end
end
end
When I am trying to access unknown action, I am getting ArgumentError exception, which confuses me.
It is because method_missing in controller has behaviour different than in Ruby. (in ruby, method missing always receives name of called method as a symbol, not as string)
After applying patch, NameError exception will be raised in given controller, which is more meaningful than ArgumentError
Comments and changes to this ticket
-
Dmitry V April 20th, 2009 @ 08:15 PM
- Tag changed from 2.x, action_controller, method_missing, patch to 2.x, 3.0, action_controller, bug, method_missing, patch
-
Dmitry V April 20th, 2009 @ 08:17 PM
- Assigned user set to Yehuda Katz (wycats)
MikeG1 said that this patch probably will not be applied in 2.3.x
-
Rizwan Reza March 26th, 2010 @ 01:01 PM
- State changed from new to open
- Milestone cleared.
This doesn't apply anymore.
It's probably a good idea to add test for this, which I have attached.
-
Rizwan Reza March 27th, 2010 @ 07:26 AM
- State changed from open to resolved
(from [167017f65558a4461aaf8dc26a6f329a283366c2]) Tests method_missing to raise NameError. [#2522 state:resolved]
Signed-off-by: wycats wycats@gmail.com
http://github.com/rails/rails/commit/167017f65558a4461aaf8dc26a6f32... -
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 2522 method_missing in controller should receive symbol instead of string (from [167017f65558a4461aaf8dc26a6f329a283366c2]) Tests m...