module ListController::Nesting

Provides functionality to nest controllers/resources. If a controller is nested, the parent classes and namespaces may be defined as an array in the :nesting class attribute. For example, a cities controller, nested in country and a admin namespace, may define this attribute as follows:

self.nesting = :admin, Country

Public Class Methods

included(controller) click to toggle source

Adds the :nesting class attribute and parent helper methods to the including controller.

# File lib/generators/dry_crud/templates/app/controllers/list_controller.rb, line 299
def self.included(controller)
  controller.class_attribute :nesting

  controller.helper_method :parent, :parents

  controller.alias_method_chain :model_scope, :nesting
  controller.alias_method_chain :path_args, :nesting
end