skip protection to aws3
This commit is contained in:
parent
a699ebdbcc
commit
4821aa6c25
2 changed files with 5 additions and 2 deletions
|
@ -1,7 +1,6 @@
|
||||||
class FilesController < ApplicationController
|
class FilesController < ApplicationController
|
||||||
def download
|
def download
|
||||||
uploader = Note.find(params[:id]).attachment
|
uploader = Note.find(params[:id]).attachment
|
||||||
uploader.retrieve_from_store!(params[:filename])
|
|
||||||
send_file uploader.file.path, disposition: 'attachment'
|
send_file uploader.file.path, disposition: 'attachment'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,6 +21,10 @@ class AttachmentUploader < CarrierWave::Uploader::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def secure_url
|
def secure_url
|
||||||
"/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}"
|
if self.class.storage == CarrierWave::Storage::File
|
||||||
|
"/files/#{model.class.to_s.underscore}/#{model.id}/#{file.filename}"
|
||||||
|
else
|
||||||
|
url
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue