Yogzzz
Yogzzz

Reputation: 2785

Rails controller inheritance

Say I have controller X which inherits from controller Y:

class X < YController

and my YController inherits from ApplicationController.

Would I still have access to all methods/classes via my X controller that are available in the ApplicationController?

Upvotes: 3

Views: 5384

Answers (1)

Andrew Hare
Andrew Hare

Reputation: 351516

Yes, you will. All methods will be inherited unless you override them in the child controller. Remember that Rails controllers are just Ruby classes and you will get the same inheritance behavior that you get with any other Ruby class.

Upvotes: 7

Related Questions