Deal with controller names on scaffold and add some helpers to deal with ActiveModel.
Methods
- C
- O
Attributes
[R] | controller_name |
Instance Protected methods
Loads the ORM::Generators::ActiveModel class. This class is responsible to tell scaffold entities how to generate an specific method for the ORM. Check Rails::Generators::ActiveModel for more information.
# File railties/lib/rails/generators/resource_helpers.rb, line 59 def orm_class @orm_class ||= begin # Raise an error if the class_option :orm was not defined. unless self.class.class_options[:orm] raise "You need to have :orm as class option to invoke orm_class and orm_instance" end begin "#{options[:orm].to_s.camelize}::Generators::ActiveModel".constantize rescue NameError Rails::Generators::ActiveModel end end end