Module: Hyrax::BatchEditsControllerBehavior

Extended by:
ActiveSupport::Concern
Includes:
Breadcrumbs
Included in:
BatchEditsController
Defined in:
app/controllers/concerns/hyrax/batch_edits_controller_behavior.rb

Instance Method Summary collapse

Methods included from Breadcrumbs

#add_breadcrumb_for_action, #build_breadcrumbs, #default_trail, #trail_from_referer

Instance Method Details

#after_destroy_collectionObject



27
28
29
# File 'app/controllers/concerns/hyrax/batch_edits_controller_behavior.rb', line 27

def after_destroy_collection
  redirect_to_return_controller unless request.xhr?
end

#after_updateObject



20
21
22
23
24
25
# File 'app/controllers/concerns/hyrax/batch_edits_controller_behavior.rb', line 20

def after_update
  respond_to do |format|
    format.json { head :no_content }
    format.html { redirect_to_return_controller }
  end
end

#editObject



13
14
15
16
17
18
# File 'app/controllers/concerns/hyrax/batch_edits_controller_behavior.rb', line 13

def edit
  super
  work = form_class.model_class.new
  work.depositor = current_user.user_key
  @form = form_class.new(work, current_user, batch)
end

#updateObject



37
38
39
40
41
42
43
44
# File 'app/controllers/concerns/hyrax/batch_edits_controller_behavior.rb', line 37

def update
  case params["update_type"]
  when "update"
    super
  when "delete_all"
    destroy_batch
  end
end

#update_document(obj) ⇒ Object



31
32
33
34
35
# File 'app/controllers/concerns/hyrax/batch_edits_controller_behavior.rb', line 31

def update_document(obj)
  obj.attributes = work_params
  obj.date_modified = Time.current.ctime
  obj.visibility = params[:visibility]
end