Class: Search::CertificationPresenter
- Inherits:
-
BasePresenter
- Object
- SimpleDelegator
- BasePresenter
- Search::CertificationPresenter
- Includes:
- Presenters::Timeable
- Defined in:
- app/presenters/search/certification_presenter.rb
Overview
Row presenter for ViewCertification — renders the cells in the CRM
certification search/results table.
Instance Attribute Summary
Attributes inherited from BasePresenter
#current_account, #options, #url_helper
Instance Method Summary collapse
-
#certification_link ⇒ ActiveSupport::SafeBuffer?
Linked certification reference → certification show page; nil when no certification is recorded.
-
#course_link ⇒ ActiveSupport::SafeBuffer
Linked course/certification name → course enrollment page.
-
#customer_link ⇒ ActiveSupport::SafeBuffer
Linked customer name → customer show page.
-
#is_inactive ⇒ String
Human-friendly inactive flag (
Yes/No). -
#state ⇒ String
Human-readable certification state name.
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
#certification_link ⇒ ActiveSupport::SafeBuffer?
Linked certification reference → certification show page; nil when
no certification is recorded.
42 43 44 |
# File 'app/presenters/search/certification_presenter.rb', line 42 def certification_link h.link_to(r.certification_reference, h.certification_path(r.certification_id)) if r.certification_id.present? end |
#course_link ⇒ ActiveSupport::SafeBuffer
Linked course/certification name → course enrollment page.
34 35 36 |
# File 'app/presenters/search/certification_presenter.rb', line 34 def course_link h.link_to(r.certification_name, h.course_enrollment_path(r.id)) end |
#customer_link ⇒ ActiveSupport::SafeBuffer
Linked customer name → customer show page.
27 28 29 |
# File 'app/presenters/search/certification_presenter.rb', line 27 def customer_link h.link_to(r.customer_name, h.customer_path(r.customer_id)) end |
#is_inactive ⇒ String
Human-friendly inactive flag (Yes/No).
13 14 15 |
# File 'app/presenters/search/certification_presenter.rb', line 13 def is_inactive h.y r.is_inactive end |
#state ⇒ String
Human-readable certification state name.
20 21 22 |
# File 'app/presenters/search/certification_presenter.rb', line 20 def state LocatorRecord.human_state_name(r.state) end |