Class: Alchemy::Custom::Model::Admin::ClonesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/alchemy/custom/model/admin/clones_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

belongs_to, #destroy, #edit, #export_csv, #export_csv_full, #index, #new, #show, #update

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/alchemy/custom/model/admin/clones_controller.rb', line 6

def create
  @obj.assign_attributes clean_params
  if @parent.present?
    @obj.send("#{@obj.class.to_cloner_name}=",@parent)
  end
  @obj = yield @obj if block_given?
  if @obj.apply
    after_successfull_create
  else
    after_unsuccessfully_create
  end
end