I can do this in the controller to get the model class:
self.class.name.gsub("Controller", "").singularize.constantize
But is there a built in method for this in the controller?
Something like self.model_class
?
Thanks!
I can do this in the controller to get the model class:
self.class.name.gsub("Controller", "").singularize.constantize
But is there a built in method for this in the controller?
Something like self.model_class
?
Thanks!