mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
parent
abf228df7a
commit
e15b1283e5
3 changed files with 12 additions and 1 deletions
|
@ -5,7 +5,14 @@ module Admin
|
|||
def show
|
||||
@ld = LegalDocument.find(params[:id])
|
||||
filename = @ld.path.split('/').last
|
||||
send_data File.open(@ld.path).read, filename: filename
|
||||
file = File.open(@ld.path).read
|
||||
|
||||
if file
|
||||
send_data file, filename: filename
|
||||
else
|
||||
flash[:notice] = I18n.t('legal_doc_not_found')
|
||||
redirect_to [:admin, @ld.documentable]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue