Class StorageObjectController
In: app/controllers/storage_object_controller.rb
Parent: ApplicationController

サーバ上に保存する添付ファイルを制御する。

Methods

download  

Public Instance methods

添付ファイルをダウンロードする。

[Source]

    # File app/controllers/storage_object_controller.rb, line 4
 4:   def download
 5:     begin
 6:       storage_object = StorageObject.find(params[:id])
 7:     rescue ActiveRecord::RecordNotFound
 8:       raise NotFoundException, "storage object not found: #{params[:id]}"
 9:     end
10:     begin
11:       send_file(storage_object.path, :type => storage_object.mime_type, :filename => storage_object.name)
12:     rescue => e
13:       logger.error(e.inspect)
14:       render :nothing => true
15:     end
16:   end

[Validate]