Module: ActiveScaffold::Actions::Nested

Defined in:
lib/active_scaffold/actions/nested.rb,
lib/active_scaffold/actions/nested.rb

Overview

The Nested module basically handles automatically linking controllers together. It does this by creating column links with the right parameters, and by providing any supporting systems (like a /:controller/nested action for returning associated scaffolds).

Defined Under Namespace

Modules: ChildMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/active_scaffold/actions/nested.rb', line 6

def self.included(base)
  super
  base.module_eval do
    before_action :set_nested
    before_action :configure_nested
    include ActiveScaffold::Actions::Nested::ChildMethods if active_scaffold_config.model.reflect_on_all_associations.any? { |a| a.macro == :has_and_belongs_to_many }
  end
  base.before_action :include_habtm_actions
  base.helper_method :nested
  base.helper_method :nested_parent_record
end