Last Updated: February 25, 2016
·
1.377K
· rshetty

Inheritance Hierarchy of your Controller

In your Rails Application, if you want to get the Inheritance Hierarchy of your Rails Controller. Use this

Fire up the Rails console using

rails c

Then use

ApplicationController.ancestors - ApplicationController.included_modules

To get the Inheritance hierarchy of your Rails Application Controller.

To get the Inheritance Hierarchy of your own Controller use as

UsersController.ancestors - UsersController.included_modules

That's it.

The Output :

[ApplicationController, ActionController::API, ActionController::Metal, AbstractController::Base, Object, BasicObject]

Source : Ryan Bates : Code Walkthrough ActionController