Class: SolidusAdmin::ReimbursementTypes::Index::Component
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- SolidusAdmin::ReimbursementTypes::Index::Component
- Includes:
- Layout::PageHelpers
- Defined in:
- app/components/solidus_admin/reimbursement_types/index/component.rb
Instance Method Summary collapse
- #batch_actions ⇒ Object
- #columns ⇒ Object
- #filters ⇒ Object
-
#initialize(page:) ⇒ Component
constructor
A new instance of Component.
- #next_page_path ⇒ Object
- #prev_page_path ⇒ Object
- #scopes ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(page:) ⇒ Component
Returns a new instance of Component.
6 7 8 |
# File 'app/components/solidus_admin/reimbursement_types/index/component.rb', line 6 def initialize(page:) @page = page end |
Instance Method Details
#batch_actions ⇒ Object
22 23 24 |
# File 'app/components/solidus_admin/reimbursement_types/index/component.rb', line 22 def batch_actions [] end |
#columns ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/components/solidus_admin/reimbursement_types/index/component.rb', line 34 def columns [ :name, { header: :active, data: ->(reimbursement_type) do reimbursement_type.active? ? component('ui/badge').yes : component('ui/badge').no end }, ] end |
#filters ⇒ Object
30 31 32 |
# File 'app/components/solidus_admin/reimbursement_types/index/component.rb', line 30 def filters [] end |
#next_page_path ⇒ Object
18 19 20 |
# File 'app/components/solidus_admin/reimbursement_types/index/component.rb', line 18 def next_page_path solidus_admin.url_for(**request.params, page: @page.next_param, only_path: true) unless @page.last? end |
#prev_page_path ⇒ Object
14 15 16 |
# File 'app/components/solidus_admin/reimbursement_types/index/component.rb', line 14 def prev_page_path solidus_admin.url_for(**request.params, page: @page.number - 1, only_path: true) unless @page.first? end |
#scopes ⇒ Object
26 27 28 |
# File 'app/components/solidus_admin/reimbursement_types/index/component.rb', line 26 def scopes [] end |
#title ⇒ Object
10 11 12 |
# File 'app/components/solidus_admin/reimbursement_types/index/component.rb', line 10 def title Spree::ReimbursementType.model_name.human.pluralize end |