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
#add_breadcrumb_for_action, #build_breadcrumbs, #default_trail, #trail_from_referer
Instance Method Details
#after_destroy_collection ⇒ Object
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_update ⇒ Object
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
|
#edit ⇒ Object
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
|
#update ⇒ Object
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
|