Class: SolidusPromotions::PromotionCategories::Index::Component
- Inherits:
-
SolidusAdmin::UI::Pages::Index::Component
- Object
- SolidusAdmin::UI::Pages::Index::Component
- SolidusPromotions::PromotionCategories::Index::Component
- Defined in:
- lib/components/admin/solidus_promotions/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
- #solidus_promotions ⇒ 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_promotions/promotion_categories/index/component.rb', line 30 def batch_actions [ { label: t(".batch_actions.delete"), action: solidus_promotions.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_promotions/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_modal }, class: 'body-link' end } end |
#columns ⇒ Object
41 42 43 44 45 46 |
# File 'lib/components/admin/solidus_promotions/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_promotions/promotion_categories/index/component.rb', line 12 def edit_path(record) solidus_promotions.edit_promotion_category_path(record, **search_filter_params) end |
#model_class ⇒ Object
4 5 6 |
# File 'lib/components/admin/solidus_promotions/promotion_categories/index/component.rb', line 4 def model_class SolidusPromotions::PromotionCategory end |
#name_column ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/components/admin/solidus_promotions/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_modal }, class: 'body-link' end } end |
#page_actions ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/components/admin/solidus_promotions/promotion_categories/index/component.rb', line 20 def page_actions render component("ui/button").new( tag: :a, text: t(".add"), href: solidus_promotions.new_promotion_category_path(**search_filter_params), data: { turbo_frame: :resource_modal }, icon: "add-line" ) end |
#solidus_promotions ⇒ Object
70 71 72 |
# File 'lib/components/admin/solidus_promotions/promotion_categories/index/component.rb', line 70 def solidus_promotions @solidus_promotions ||= SolidusPromotions::Engine.routes.url_helpers end |
#title ⇒ Object
8 9 10 |
# File 'lib/components/admin/solidus_promotions/promotion_categories/index/component.rb', line 8 def title t('solidus_promotions.promotion_categories.title') end |
#turbo_frames ⇒ Object
16 17 18 |
# File 'lib/components/admin/solidus_promotions/promotion_categories/index/component.rb', line 16 def turbo_frames %w[resource_modal] end |