Method_missing in controller


I am using a method_missing method into a controller.
I have a route that says:

match ‘:controller/:action’

What surprise me is that if a view that match the action name exists
method_missing is not invoked but rails happily render the view.
I was expecting that method_missing was going to be invoked if

Is that a normal behaviour?



On May 11, 2:54pm, andreacfm [email protected] wrote:


Is that a normal behaviour?

Yes - you don’t need an empty method body if all you want to do is
render a template (although you might consider it more readable code
if there was an empty method body)


Was is not clear is why the method_missing method is not invoked if I
declare it.
Looks like rails render the view if exists before checking if a
method_missing exists in the controller.


On May 11, 5:12pm, Frederick C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs