Class: SolidusAdmin::Taxonomies::Index::Component
- Inherits:
-
UI::Pages::Index::Component
- Object
- UI::Pages::Index::Component
- SolidusAdmin::Taxonomies::Index::Component
- Defined in:
- app/components/solidus_admin/taxonomies/index/component.rb
Instance Method Summary collapse
- #batch_actions ⇒ Object
- #columns ⇒ Object
- #model_class ⇒ Object
- #name_column ⇒ Object
- #page_actions ⇒ Object
- #row_url(taxonomy) ⇒ Object
- #sortable_options ⇒ Object
Instance Method Details
#batch_actions ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'app/components/solidus_admin/taxonomies/index/component.rb', line 28 def batch_actions [ { label: t('.batch_actions.delete'), action: solidus_admin.taxonomies_path, method: :delete, icon: 'delete-bin-7-line', }, ] end |
#columns ⇒ Object
39 40 41 42 43 |
# File 'app/components/solidus_admin/taxonomies/index/component.rb', line 39 def columns [ name_column, ] end |
#model_class ⇒ Object
4 5 6 |
# File 'app/components/solidus_admin/taxonomies/index/component.rb', line 4 def model_class Spree::Taxonomy end |
#name_column ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'app/components/solidus_admin/taxonomies/index/component.rb', line 45 def name_column { header: :name, data: ->(taxonomy) do content_tag :div, taxonomy.name end } end |
#page_actions ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'app/components/solidus_admin/taxonomies/index/component.rb', line 19 def page_actions render component("ui/button").new( tag: :a, text: t('.add'), href: spree.new_admin_taxonomy_path, icon: "add-line", ) end |
#row_url(taxonomy) ⇒ Object
8 9 10 |
# File 'app/components/solidus_admin/taxonomies/index/component.rb', line 8 def row_url(taxonomy) spree.edit_admin_taxonomy_path(taxonomy) end |
#sortable_options ⇒ Object
12 13 14 15 16 17 |
# File 'app/components/solidus_admin/taxonomies/index/component.rb', line 12 def { url: ->(taxonomy) { solidus_admin.move_taxonomy_path(taxonomy) }, param: 'position', } end |