internetee-registry/app/controllers/admin/legal_documents_controller.rb
2014-12-30 12:14:55 +02:00

9 lines
258 B
Ruby

class Admin::LegalDocumentsController < AdminController
load_and_authorize_resource
def show
@ld = LegalDocument.find(params[:id])
file = Base64.decode64(@ld.body)
send_data file, filename: "#{@ld.created_at}.#{@ld.document_type}"
end
end