Class: AttachmentReferencesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/attachment_references_controller.rb

Instance Method Summary collapse

Methods included from ApplicationSignInCallbacksConcern

#sign_in

Methods included from ApplicationPaginationConcern

#page_param

Methods included from ApplicationAnnouncementsConcern

#global_announcements, #unread_global_announcements

Methods included from ApplicationInstanceUserConcern

#current_instance_user

Methods included from ApplicationUserTimeZoneConcern

#set_time_zone

Methods included from ApplicationUserConcern

#handle_access_denied, #publicly_accessible?

Methods included from ApplicationComponentsConcern

#handle_component_not_found

Instance Method Details

#destroyObject


9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/attachment_references_controller.rb', line 9

def destroy
  authorize!(:destroy_attachment, @attachment_reference.attachable)

  success = @attachment_reference.destroy

  respond_to do |format|
    format.html { render_html_response(success) }
    format.json { render_json_response(success) }
  end
end

#showObject


5
6
7
# File 'app/controllers/attachment_references_controller.rb', line 5

def show
  redirect_to @attachment_reference.url(filename: @attachment_reference.name)
end