Can anyone explain where render() comes from in
ActionController::Base?
I managed to trace it down only that far:
ActionController::Base includes ActionController::Rendering module where
render() method is defined. This definition however calls to render() of
the superclass. Superclass is ActionController::Metal. Which in its
turn inherits from AbstractController::Base. None of those have render
() either defined or included.
Now, presumably it comes from AbstractController::Rendering, but I’m
really missing how it gets included.
The
rendermethod you call in your action is defined inActionController::Base.This method passes the call to
superwhich calls therendermethod defined inActionController::Rendering.ActionController::Renderingis effectively a Module, mixed into the ActionController::Base class at the beginning of thebase.rbfile.In turns,
ActionController::RenderingincludesAbstractController::Renderingas you can see in theActionController::Renderingmodule definition.AbstractController::Renderingprovides arendermethod which is the final method invoked in the render chain.The full chain is