Method_missing in controller

Hi,

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
declarated.

Is that a normal behaviour?

Thanks

Andrea

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

declarated.

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)

Fred

Thanks.
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.

Andrea

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