Module: FlexaDownloadable::DownloadHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/flexa_downloadable/download_helper.rb
Instance Method Summary collapse
- #file_path(file, width = nil, height = nil) ⇒ Object
- #image(file, **args) ⇒ Object
- #link_to_file(file) ⇒ Object
Instance Method Details
#file_path(file, width = nil, height = nil) ⇒ Object
11 12 13 14 |
# File 'app/helpers/flexa_downloadable/download_helper.rb', line 11 def file_path(file, width = nil, height = nil) flexa_downloadable.image_path(id: file.id, filename: file.filename, \ width: width, height: height) end |
#image(file, **args) ⇒ Object
7 8 9 |
# File 'app/helpers/flexa_downloadable/download_helper.rb', line 7 def image(file, **args) image_tag file_path(file, args[:w], args[:h]), args end |
#link_to_file(file) ⇒ Object
3 4 5 |
# File 'app/helpers/flexa_downloadable/download_helper.rb', line 3 def link_to_file(file) link_to file.filename, file_path(file) end |