Deal with controller names on scaffold and add some helpers to deal with ActiveModel.

Methods
C
O
Attributes
[R] controller_name
Instance Protected methods
controller_class_name()
# File railties/lib/rails/generators/resource_helpers.rb, line 48
def controller_class_name
  (controller_class_path + [controller_file_name]).map!{ |m| m.camelize }.join('::')
end
controller_class_path()
# File railties/lib/rails/generators/resource_helpers.rb, line 36
def controller_class_path
  class_path
end
controller_file_name()
# File railties/lib/rails/generators/resource_helpers.rb, line 40
def controller_file_name
  @controller_file_name ||= file_name.pluralize
end
controller_file_path()
# File railties/lib/rails/generators/resource_helpers.rb, line 44
def controller_file_path
  @controller_file_path ||= (controller_class_path + [controller_file_name]).join('/')
end
controller_i18n_scope()
# File railties/lib/rails/generators/resource_helpers.rb, line 52
def controller_i18n_scope
  @controller_i18n_scope ||= controller_file_path.gsub('/', '.')
end
orm_class()

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
orm_instance(name=singular_table_name)

Initialize ORM::Generators::ActiveModel to access instance methods.

# File railties/lib/rails/generators/resource_helpers.rb, line 75
def orm_instance(name=singular_table_name)
  @orm_instance ||= orm_class.new(name)
end