Class: ActiveScaffold::Config::Subform

Inherits:
Base show all
Defined in:
lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/subform.rb

Constant Summary collapse

@@per_page =
:horizontal

Instance Attribute Summary collapse

Attributes inherited from Base

#user

Instance Method Summary collapse

Methods inherited from Base

#crud_type, #formats, #formats=, inherited

Methods included from ActiveScaffold::Configurable

#configure, #method_missing

Constructor Details

#initialize(core_config) ⇒ Subform

Returns a new instance of Subform.



3
4
5
6
7
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/subform.rb', line 3

def initialize(core_config)
  @core = core_config
  # AST - don't force me to set :vertical on every scaffold
  @layout = self.class.layout || :horizontal
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveScaffold::Configurable

Instance Attribute Details

#layoutObject

instance-level configuration




18
19
20
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/subform.rb', line 18

def layout
  @layout
end

Instance Method Details

#columnsObject

provides access to the list of columns specifically meant for the Sub-Form to use



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/subform.rb', line 21

def columns
  # we want to delay initializing to the @core.update.columns set for as long as possible. but we have to eventually clone, or else have a configuration "leak"
  unless @columns
    if @core.actions.include? :update
      @columns = @core.update.columns.clone
    else
      self.columns = @core.columns._inheritable
    end
  end

  @columns
end

#columns=(val) ⇒ Object



34
35
36
37
38
# File 'lib/six-updater-web/vendor/plugins/active_scaffold/lib/active_scaffold/config/subform.rb', line 34

def columns=(val)
  @columns = ActiveScaffold::DataStructures::ActionColumns.new(*val)
  @columns.action = self
  return @columns
end