Class: AttachmentPresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- AttachmentPresenter
- Defined in:
- app/presenters/attachment_presenter.rb
Overview
Present an Attachment
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary (collapse)
-
- (Object) image_or_link
render the image with a link to open a larger view in a popup-div if content_type is image otherwise render a link to download the file.
Methods inherited from BasePresenter
Constructor Details
This class inherits a constructor from BasePresenter
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BasePresenter
Instance Method Details
- (Object) image_or_link
render the image with a link to open a larger view in a popup-div if content_type is image otherwise render a link to download the file.
9 10 11 12 13 14 15 |
# File 'app/presenters/attachment_presenter.rb', line 9 def image_or_link if .file.content_type =~ /image/ link_to_function( h.image_tag( w3c_url(.file.url(:icon)) ), "image_popup('#{.file.url(:popup)}')") else .file.original_filename, "button download small", .file.url() end end |