Class: ActiveScaffold::Config::Create
- Defined in:
- lib/active_scaffold/config/create.rb
Constant Summary collapse
- @@link =
ActiveScaffold::DataStructures::ActionLink.new('new', :label => :create_new, :type => :collection, :security_method => :create_authorized?, :ignore_method => :create_ignore?)
- @@persistent =
false
- @@action_after_create =
false
- @@refresh_list =
false
Instance Attribute Summary collapse
-
#action_after_create ⇒ Object
whether the form stays open after a create or not.
-
#persistent ⇒ Object
whether the form stays open after a create or not.
-
#refresh_list ⇒ Object
whether we should refresh list after create or not.
Attributes inherited from Form
#link, #multipart, #show_unauthorized_columns
Attributes inherited from Base
Class Method Summary collapse
-
.link ⇒ Object
global level configuration ————————– the ActionLink for this action.
- .link=(val) ⇒ Object
Instance Method Summary collapse
-
#initialize(*args) ⇒ Create
constructor
A new instance of Create.
-
#label(model = nil) ⇒ Object
instance-level configuration —————————- the label= method already exists in the Form base class.
Methods inherited from Form
Methods inherited from Base
#crud_type, #formats, #formats=, inherited
Methods included from ActiveScaffold::Configurable
Constructor Details
#initialize(*args) ⇒ Create
Returns a new instance of Create.
4 5 6 7 8 9 |
# File 'lib/active_scaffold/config/create.rb', line 4 def initialize(*args) super 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_create ⇒ Object
whether the form stays open after a create or not
46 47 48 |
# File 'lib/active_scaffold/config/create.rb', line 46 def action_after_create @action_after_create end |
#persistent ⇒ Object
whether the form stays open after a create or not
43 44 45 |
# File 'lib/active_scaffold/config/create.rb', line 43 def persistent @persistent end |
#refresh_list ⇒ Object
whether we should refresh list after create or not
49 50 51 |
# File 'lib/active_scaffold/config/create.rb', line 49 def refresh_list @refresh_list end |
Class Method Details
.link ⇒ Object
global level configuration
the ActionLink for this action
14 15 16 |
# File 'lib/active_scaffold/config/create.rb', line 14 def self.link @@link end |
.link=(val) ⇒ Object
17 18 19 |
# File 'lib/active_scaffold/config/create.rb', line 17 def self.link=(val) @@link = val end |
Instance Method Details
#label(model = nil) ⇒ Object
instance-level configuration
the label= method already exists in the Form base class
37 38 39 40 |
# File 'lib/active_scaffold/config/create.rb', line 37 def label(model = nil) model ||= @core.label(:count => 1) @label ? as_(@label) : as_(:create_model, :model => model) end |