mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 15:44:45 +02:00
parent
abf228df7a
commit
e15b1283e5
3 changed files with 12 additions and 1 deletions
|
@ -5,7 +5,14 @@ module Admin
|
||||||
def show
|
def show
|
||||||
@ld = LegalDocument.find(params[:id])
|
@ld = LegalDocument.find(params[:id])
|
||||||
filename = @ld.path.split('/').last
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
2
config/locales/admin/legal_documents.en.yml
Normal file
2
config/locales/admin/legal_documents.en.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
en:
|
||||||
|
legal_doc_not_found: "There is an error downloading legal document: file not found"
|
2
config/locales/admin/legal_documents.et.yml
Normal file
2
config/locales/admin/legal_documents.et.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
et:
|
||||||
|
legal_doc_not_found: "Viga juriidilise dokumendi allalaadimisel: faili ei leitud"
|
Loading…
Add table
Add a link
Reference in a new issue