Class: Lcms::Engine::DownloadsController
Constant Summary
AnalyticsTracking::GA_DEBUG_MODE
Instance Method Summary
collapse
Instance Method Details
#pdf_proxy ⇒ Object
22
23
24
25
26
27
28
|
# File 'app/controllers/lcms/engine/downloads_controller.rb', line 22
def pdf_proxy
uri = URI.parse attachment_url
send_data uri.open.read,
disposition: :inline,
file_name: attachment_url.split('/').last,
type: 'application/pdf'
end
|
#preview ⇒ Object
14
15
16
17
18
19
20
|
# File 'app/controllers/lcms/engine/downloads_controller.rb', line 14
def preview
ga_track('preview')
@resource = resource_download.resource
RestClient.head(attachment_url)
rescue RestClient::ExceptionWithResponse => e
render text: e.response, status: '404'
end
|
#show ⇒ Object
10
11
12
|
# File 'app/controllers/lcms/engine/downloads_controller.rb', line 10
def show
redirect_to attachment_url
end
|