Class: Search::CouponPresenter

Inherits:
BasePresenter show all
Includes:
Presenters::Timeable
Defined in:
app/presenters/search/coupon_presenter.rb

Overview

Row presenter for ViewCoupon — renders the cells in the CRM coupon
search/results table.

Direct Known Subclasses

CouponTextPresenter

Instance Attribute Summary

Attributes inherited from BasePresenter

#current_account, #options, #url_helper

Instance Method Summary collapse

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

Linked coupon code → coupon show page.

Returns:

  • (ActiveSupport::SafeBuffer)


20
21
22
# File 'app/presenters/search/coupon_presenter.rb', line 20

def coupon_link
  h.link_to r.code, h.coupon_path(r.id), class: 'btn btn-outline-primary btn-block'
end

#statusString

Human-readable coupon status (active/inactive).

Returns:

  • (String)


13
14
15
# File 'app/presenters/search/coupon_presenter.rb', line 13

def status
  r.status.humanize.titleize
end