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
Written by Rajeev N Bharshetty
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#