Class: CafeCar::ActiveStorage::AttachmentPresenter
- Inherits:
-
Object
- Object
- CafeCar::ActiveStorage::AttachmentPresenter
show all
- Defined in:
- app/presenters/cafe_car/active_storage/attachment_presenter.rb
Instance Method Summary
collapse
Instance Method Details
#blank ⇒ Object
8
|
# File 'app/presenters/cafe_car/active_storage/attachment_presenter.rb', line 8
def blank = options[:blank]
|
#image ⇒ Object
11
12
13
|
# File 'app/presenters/cafe_car/active_storage/attachment_presenter.rb', line 11
def image
@template.image_tag url, **options, class: ui.class(:image, size) if url
end
|
#logo ⇒ Object
9
|
# File 'app/presenters/cafe_car/active_storage/attachment_presenter.rb', line 9
def logo = self
|
#preview ⇒ Object
15
|
# File 'app/presenters/cafe_car/active_storage/attachment_presenter.rb', line 15
def preview = image || blank
|
#url ⇒ Object
def url = object.representation(resize_to_limit: [300, 300])&.processed&.url
7
|
# File 'app/presenters/cafe_car/active_storage/attachment_presenter.rb', line 7
def url = object.try(:url)
|