Class: Spina::Admin::AttachmentsController
Instance Method Summary
collapse
#captcha, #current_account, #error_explanation!, #image_tag_with_at2x, #link_to_add_fields, #markdown
Instance Method Details
#create ⇒ Object
16
17
18
|
# File 'app/controllers/spina/admin/attachments_controller.rb', line 16
def create
@attachment = Attachment.create(attachment_params)
end
|
#destroy ⇒ Object
20
21
22
23
24
|
# File 'app/controllers/spina/admin/attachments_controller.rb', line 20
def destroy
@attachment = Attachment.find(params[:id])
@attachment.destroy
redirect_to spina.admin_attachments_url
end
|
#index ⇒ Object
10
11
12
13
14
|
# File 'app/controllers/spina/admin/attachments_controller.rb', line 10
def index
add_breadcrumb I18n.t('spina.website.documents'), spina.admin_attachments_path
@attachments = Attachment.file_attached.sorted
@attachment = Attachment.new
end
|
#insert ⇒ Object
31
32
33
|
# File 'app/controllers/spina/admin/attachments_controller.rb', line 31
def insert
@attachment = Attachment.find(params[:attachment_id])
end
|
#insert_collection ⇒ Object
40
41
42
|
# File 'app/controllers/spina/admin/attachments_controller.rb', line 40
def insert_collection
@attachments = Attachment.find(params[:attachment_ids])
end
|
#select ⇒ Object
26
27
28
29
|
# File 'app/controllers/spina/admin/attachments_controller.rb', line 26
def select
@attachments = Attachment.file_attached.sorted
@attachment = Attachment.new
end
|
#select_collection ⇒ Object
35
36
37
38
|
# File 'app/controllers/spina/admin/attachments_controller.rb', line 35
def select_collection
@attachments = Attachment.file_attached.sorted
@attachment = Attachment.new
end
|