Class: CurationConcern::LinkedResourcesController
Instance Method Summary
collapse
#parent
#authorize_curation_concern!, #contributor_agreement
Instance Method Details
#attach_action_breadcrumb ⇒ Object
49
50
51
52
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 49
def attach_action_breadcrumb
add_breadcrumb "#{parent.human_readable_type}", polymorphic_path([:curation_concern, parent])
super
end
|
#create ⇒ Object
15
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 15
def create
curation_concern.batch = parent
if actor.create
respond_with([:curation_concern, parent])
else
respond_with([:curation_concern, curation_concern]) { |wants|
wants.html { render 'new', status: :unprocessable_entity }
}
end
end
|
#destroy ⇒ Object
40
41
42
43
44
45
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 40
def destroy
parent = curation_concern.batch
flash[:notice] = "Deleted #{curation_concern}"
curation_concern.destroy
respond_with([:curation_concern, parent])
end
|
#edit ⇒ Object
26
27
28
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 26
def edit
respond_with(curation_concern)
end
|
#new ⇒ Object
11
12
13
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 11
def new
respond_with(curation_concern)
end
|
#update ⇒ Object
30
31
32
33
34
35
36
37
38
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 30
def update
if actor.update
respond_with([:curation_concern, curation_concern.batch])
else
respond_with([:curation_concern, curation_concern]) { |wants|
wants.html { render 'edit', status: :unprocessable_entity }
}
end
end
|