Module: Crm::ShowcasesHelper
- Defined in:
- app/helpers/crm/showcases_helper.rb
Overview
View helpers for the CRM showcases screens.
Instance Method Summary collapse
-
#showcase_state_badge(state) ⇒ String
Renders a colored Bootstrap badge for a showcase state.
Instance Method Details
#showcase_state_badge(state) ⇒ String
Renders a colored Bootstrap badge for a showcase state.
11 12 13 14 15 16 17 18 |
# File 'app/helpers/crm/showcases_helper.rb', line 11 def showcase_state_badge(state) color = case state when 'published' then 'success' when 'draft' then 'warning' else 'secondary' end content_tag :span, state.to_s.humanize, class: "badge bg-#{color}" end |