Even though, it is a beginner rails question, I wanted to ask on here, stackoverflow, just to get the logic of this right
Basically I’m looking for a solution to create an abstract class (but since we are mentioning about rails, it’s more like abstract models). The reason why I could not understand it is because I always generate my models and controllers (without scaffold) and I couldn’t find any online solution such that I will generate a model that inherits from an abstract class I’ve predefined.
Basically, assume that I have a class Creature with common attributes like eyes, nose etc. and I want to create Human and Dog class inheriting from that class. How would I be able to do that. Would it be possible to add an option to terminal command rails g controller Human inherits:Create or anything like that.
Sincerely, looking for the common and the efficient solution.
No, rails generators don’t have this functionality, but you always can do it by yourself.