class ActiveScaffold::Config::BatchCreate
Attributes
default_batch_by_column[RW]
you may use create_batch to create a record for each record of a belong_to association (reverse must be has_many) eg. player belongs to team you may batch create a player records for a list of teams
layout[RW]
layout for create multiple records
list_mode_enabled[RW]
process_mode[RW]
see class accessor
run_in_transaction[RW]
run all create statements in a transaction, so no record is created if someone fails
Public Class Methods
link()
click to toggle source
global level configuration
the ActionLink for this action
# File lib/active_scaffold/config/batch_create.rb, line 16 def self.link @@link end
link=(val)
click to toggle source
# File lib/active_scaffold/config/batch_create.rb, line 19 def self.link=(val) @@link = val end
new(*args)
click to toggle source
Calls superclass method
# File lib/active_scaffold/config/batch_create.rb, line 4 def initialize(*args) super @multipart = @core.create.multipart? if @core.actions.include? :create @process_mode = self.class.process_mode @list_mode_enabled = self.class.list_mode_enabled @run_in_transaction = self.class.run_in_transaction @layout = self.class.layout end
Public Instance Methods
action_group()
click to toggle source
# File lib/active_scaffold/config/batch_create.rb, line 69 def action_group @action_group || (default_batch_by_column ? 'collection.batch' : 'collection') end
label(model = nil)
click to toggle source
the label= method already exists in the Form base class
# File lib/active_scaffold/config/batch_create.rb, line 74 def label(model = nil) model ||= @core.label(:count => 2) @label ? as_(@label) : as_(:create_model, :model => model) end