Class: SolidusAdmin::PromotionCategories::Index::Component
- Inherits:
-
UI::Pages::Index::Component
- Object
- UI::Pages::Index::Component
- SolidusAdmin::PromotionCategories::Index::Component
- Defined in:
- lib/components/admin/solidus_admin/promotion_categories/index/component.rb
Instance Method Summary collapse
- #batch_actions ⇒ Object
- #code_column ⇒ Object
- #columns ⇒ Object
- #edit_path(record) ⇒ Object
- #model_class ⇒ Object
- #name_column ⇒ Object
- #page_actions ⇒ Object
- #title ⇒ Object
- #turbo_frames ⇒ Object
Instance Method Details
#batch_actions ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 30 def batch_actions [ { label: t('.batch_actions.delete'), action: solidus_admin.promotion_categories_path(**search_filter_params), method: :delete, icon: 'delete-bin-7-line', }, ] end |
#code_column ⇒ Object
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 59 def code_column { header: :code, data: ->(record) do link_to record.code, edit_path(record), data: { turbo_frame: :resource_form }, class: 'body-link' end } end |
#columns ⇒ Object
41 42 43 44 45 46 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 41 def columns [ name_column, code_column, ] end |
#edit_path(record) ⇒ Object
12 13 14 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 12 def edit_path(record) solidus_admin.edit_promotion_category_path(record, **search_filter_params) end |
#model_class ⇒ Object
4 5 6 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 4 def model_class Spree::PromotionCategory end |
#name_column ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 48 def name_column { header: :name, data: ->(record) do link_to record.name, edit_path(record), data: { turbo_frame: :resource_form }, class: 'body-link' end } end |
#page_actions ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 20 def page_actions render component("ui/button").new( tag: :a, text: t('.add'), href: solidus_admin.new_promotion_category_path(**search_filter_params), data: { turbo_frame: :resource_form }, icon: "add-line", ) end |
#title ⇒ Object
8 9 10 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 8 def title t('solidus_admin.promotion_categories.title') end |
#turbo_frames ⇒ Object
16 17 18 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 16 def turbo_frames %w[resource_form] end |