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
- #model_class ⇒ Object
- #name_column ⇒ Object
- #page_actions ⇒ Object
- #row_url(promotion_category) ⇒ Object
Instance Method Details
#batch_actions ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 21 def batch_actions [ { label: t('.batch_actions.delete'), action: solidus_admin.promotion_categories_path, method: :delete, icon: 'delete-bin-7-line', }, ] end |
#code_column ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 48 def code_column { header: :code, data: ->(promotion_category) do content_tag :div, promotion_category.code end } end |
#columns ⇒ Object
32 33 34 35 36 37 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 32 def columns [ name_column, code_column, ] 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
39 40 41 42 43 44 45 46 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 39 def name_column { header: :name, data: ->(promotion_category) do content_tag :div, promotion_category.name end } end |
#page_actions ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 12 def page_actions render component("ui/button").new( tag: :a, text: t('.add'), href: spree.new_admin_promotion_category_path, icon: "add-line", ) end |
#row_url(promotion_category) ⇒ Object
8 9 10 |
# File 'lib/components/admin/solidus_admin/promotion_categories/index/component.rb', line 8 def row_url(promotion_category) spree.edit_admin_promotion_category_path(promotion_category) end |