Class: ActiveScaffold::Config::Create

Inherits:
Form show all
Defined in:
lib/active_scaffold/config/create.rb

Constant Summary collapse

ActiveScaffold::DataStructures::ActionLink.new('new', :label => :create_new, :type => :collection, :security_method => :create_authorized?, :ignore_method => :create_ignore?)
@@persistent =
false
@@action_after_create =
nil
@@refresh_list =
false

Instance Attribute Summary collapse

Attributes inherited from Form

#label, #link, #multipart, #show_unauthorized_columns

Attributes inherited from Base

#action_group, #user

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Form

#columns, #multipart?

Methods inherited from Base

#crud_type, #formats, #formats=, inherited, #label

Methods included from ActiveScaffold::Configurable

#configure, #method_missing

Constructor Details

#initialize(core_config) ⇒ Create

Returns a new instance of Create.



4
5
6
7
8
9
10
# File 'lib/active_scaffold/config/create.rb', line 4

def initialize(core_config)
  super
  @label = :create_model
  self.persistent = self.class.persistent
  self.action_after_create = self.class.action_after_create
  self.refresh_list = self.class.refresh_list
end

Dynamic Method Handling

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

Instance Attribute Details

#action_after_createObject

whether the form stays open after a create or not



39
40
41
# File 'lib/active_scaffold/config/create.rb', line 39

def action_after_create
  @action_after_create
end

#persistentObject

whether the form stays open after a create or not



36
37
38
# File 'lib/active_scaffold/config/create.rb', line 36

def persistent
  @persistent
end

#refresh_listObject

whether we should refresh list after create or not



42
43
44
# File 'lib/active_scaffold/config/create.rb', line 42

def refresh_list
  @refresh_list
end

Class Method Details

global level configuration


the ActionLink for this action



15
16
17
# File 'lib/active_scaffold/config/create.rb', line 15

def self.link
  @@link
end

.link=(val) ⇒ Object



18
19
20
# File 'lib/active_scaffold/config/create.rb', line 18

def self.link=(val)
  @@link = val
end