Class: CurationConcern::GenericWorksController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- CurationConcern::GenericWorksController
show all
- Includes:
- Morphine
- Defined in:
- app/controllers/curation_concern/generic_works_controller.rb
Instance Attribute Summary
#curation_concern
Instance Method Summary
collapse
#authorize_curation_concern!, #contributor_agreement
Instance Method Details
#create ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 9
def create
if verify_acceptance_of_user_agreement!
self.curation_concern.inner_object.pid = CurationConcern.mint_a_pid
if actor.create
after_create_response
else
setup_form
respond_with([:curation_concern, curation_concern]) do |wants|
wants.html { render 'new', status: :unprocessable_entity }
end
end
end
end
|
#destroy ⇒ Object
81
82
83
84
85
|
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 81
def destroy
title = curation_concern.to_s
curation_concern.destroy
after_destroy_response
end
|
#edit ⇒ Object
56
57
58
59
|
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 56
def edit
setup_form
respond_with(curation_concern)
end
|
#hash_key_for_curation_concern ⇒ Object
110
111
112
|
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 110
def hash_key_for_curation_concern
curation_concern_type.name.underscore.to_sym
end
|
#new ⇒ Object
5
6
7
|
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 5
def new
setup_form
end
|
#show ⇒ Object
52
53
54
|
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 52
def show
respond_with(curation_concern)
end
|
#update ⇒ Object
61
62
63
64
65
66
67
68
69
70
|
# File 'app/controllers/curation_concern/generic_works_controller.rb', line 61
def update
if actor.update
after_update_response
else
setup_form
respond_with([:curation_concern, curation_concern]) do |wants|
wants.html { render 'edit', status: :unprocessable_entity }
end
end
end
|