Class: CurationConcern::LinkedResourcesController
Instance Attribute Summary collapse
Instance Method Summary
collapse
#parent, #parent_id
#show_site_actions?, #show_site_search?
Instance Attribute Details
#actor ⇒ Object
52
53
54
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 52
def actor
@actor ||= Worthwhile::CurationConcern.actor(curation_concern, current_user, params[:linked_resource])
end
|
Instance Method Details
#attach_action_breadcrumb ⇒ Object
46
47
48
49
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 46
def attach_action_breadcrumb
add_breadcrumb "#{parent.human_readable_type}", polymorphic_path([:curation_concern, parent])
super
end
|
#create ⇒ Object
14
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 14
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
|
#curation_concern ⇒ Object
56
57
58
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 56
def curation_concern
@curation_concern
end
|
#destroy ⇒ Object
39
40
41
42
43
44
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 39
def destroy
parent = curation_concern.batch
flash[:notice] = "Deleted #{curation_concern}"
curation_concern.destroy
respond_with([:curation_concern, parent])
end
|
#edit ⇒ Object
25
26
27
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 25
def edit
respond_with(curation_concern)
end
|
#new ⇒ Object
10
11
12
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 10
def new
respond_with(curation_concern)
end
|
#update ⇒ Object
29
30
31
32
33
34
35
36
37
|
# File 'app/controllers/curation_concern/linked_resources_controller.rb', line 29
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
|