Class: Search::ItemPresenter
- Inherits:
-
BasePresenter
- Object
- SimpleDelegator
- BasePresenter
- Search::ItemPresenter
- Includes:
- Presenters::Timeable
- Defined in:
- app/presenters/search/item_presenter.rb
Overview
Renders CRM item search result rows as HTML cells.
Wraps a ViewItem projection and produces thumbnail links, SKU/name
links, and a yes/no discontinued indicator.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BasePresenter
#current_account, #options, #url_helper
Instance Method Summary collapse
-
#is_discontinued ⇒ ActiveSupport::SafeBuffer
Y/ blank indicator for discontinued status. -
#item_thumbnail_link ⇒ ActiveSupport::SafeBuffer
Item thumbnail image linked to the item show page.
-
#name_with_link ⇒ ActiveSupport::SafeBuffer
Linked item name → item show page.
-
#sku_with_link ⇒ ActiveSupport::SafeBuffer
Linked item SKU → item show page.
Methods inherited from BasePresenter
#can?, #capture, #concat, #content_tag, #fa_icon, #h, #initialize, #link_to, #number_to_currency, #present, presents, #r, #safe_present, #simple_format, #u
Constructor Details
This class inherits a constructor from BasePresenter
Instance Method Details
#is_discontinued ⇒ ActiveSupport::SafeBuffer
Y / blank indicator for discontinued status.
36 37 38 |
# File 'app/presenters/search/item_presenter.rb', line 36 def is_discontinued h.y r.is_discontinued end |
#item_thumbnail_link ⇒ ActiveSupport::SafeBuffer
Item thumbnail image linked to the item show page.
15 16 17 |
# File 'app/presenters/search/item_presenter.rb', line 15 def item_thumbnail_link h.item_thumbnail_link r end |
#name_with_link ⇒ ActiveSupport::SafeBuffer
Linked item name → item show page.
29 30 31 |
# File 'app/presenters/search/item_presenter.rb', line 29 def name_with_link h.link_to r.name, h.item_path(r.id) end |
#sku_with_link ⇒ ActiveSupport::SafeBuffer
Linked item SKU → item show page.
22 23 24 |
# File 'app/presenters/search/item_presenter.rb', line 22 def sku_with_link h.link_to r.sku, h.item_path(r.id) end |