Class: CurationConcern::GenericFilesController
Instance Method Summary
collapse
#parent
#authorize_curation_concern!, #contributor_agreement
Instance Method Details
#attach_action_breadcrumb ⇒ Object
6
7
8
9
|
# File 'app/controllers/curation_concern/generic_files_controller.rb', line 6
def attach_action_breadcrumb
add_breadcrumb "#{parent.human_readable_type}", polymorphic_path([:curation_concern, parent])
super
end
|
#create ⇒ Object
27
28
29
30
31
32
33
34
35
36
|
# File 'app/controllers/curation_concern/generic_files_controller.rb', line 27
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
71
72
73
74
75
76
|
# File 'app/controllers/curation_concern/generic_files_controller.rb', line 71
def destroy
parent = curation_concern.batch
flash[:notice] = "Deleted #{curation_concern}"
curation_concern.destroy
respond_with([:curation_concern, parent])
end
|
#edit ⇒ Object
43
44
45
|
# File 'app/controllers/curation_concern/generic_files_controller.rb', line 43
def edit
respond_with(curation_concern)
end
|
#new ⇒ Object
22
23
24
25
|
# File 'app/controllers/curation_concern/generic_files_controller.rb', line 22
def new
curation_concern.copy_permissions_from(parent)
respond_with(curation_concern)
end
|
#rollback ⇒ Object
61
62
63
64
65
66
67
68
69
|
# File 'app/controllers/curation_concern/generic_files_controller.rb', line 61
def rollback
if actor.rollback
respond_with([:curation_concern, curation_concern])
else
respond_with([:curation_concern, curation_concern]) { |wants|
wants.html { render 'versions', status: :unprocessable_entity }
}
end
end
|
#show ⇒ Object
39
40
41
|
# File 'app/controllers/curation_concern/generic_files_controller.rb', line 39
def show
respond_with(curation_concern)
end
|
#update ⇒ Object
47
48
49
50
51
52
53
54
55
|
# File 'app/controllers/curation_concern/generic_files_controller.rb', line 47
def update
if actor.update
respond_with([:curation_concern, curation_concern])
else
respond_with([:curation_concern, curation_concern]) { |wants|
wants.html { render 'edit', status: :unprocessable_entity }
}
end
end
|
#versions ⇒ Object
57
58
59
|
# File 'app/controllers/curation_concern/generic_files_controller.rb', line 57
def versions
respond_with(curation_concern)
end
|