Class: ActiveAdmin::Views::StatusTag
- Defined in:
- lib/active_admin/views/components/status_tag.rb
Overview
Build a StatusTag
Instance Method Summary collapse
- #status_tag(status, options = {}) ⇒ ActiveAdmin::Views::StatusTag
- #default_class_name ⇒ Object
- #tag_name ⇒ Object
Instance Method Details
#status_tag(status, options = {}) ⇒ ActiveAdmin::Views::StatusTag
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/active_admin/views/components/status_tag.rb', line 32 def build(status, = {}) label = .delete(:label) classes = .delete(:class) status = convert_to_boolean_status(status) if status content = label || if s = status.to_s and s.present? I18n.t "active_admin.status_tag.#{s.downcase}", default: s.titleize end end super(content, ) add_class(status_to_class(status)) if status add_class(classes) if classes end |
#default_class_name ⇒ Object
12 13 14 |
# File 'lib/active_admin/views/components/status_tag.rb', line 12 def default_class_name "status_tag" end |
#tag_name ⇒ Object
8 9 10 |
# File 'lib/active_admin/views/components/status_tag.rb', line 8 def tag_name "span" end |