Class: Spree::Admin::PriceListProductsController

Inherits:
ResourceController show all
Includes:
BulkOperationsConcern
Defined in:
app/controllers/spree/admin/price_list_products_controller.rb

Instance Method Summary collapse

Methods included from BulkOperationsConcern

#bulk_add_tags, #bulk_remove_tags

Methods inherited from ResourceController

belongs_to, #create, #destroy, #edit, #index, #new, #update

Methods included from TableConcern

#apply_table_sort, #custom_sort_active?, #process_table_query_state, #table, #table_key, #table_registered?

Methods included from BreadcrumbConcern

#add_breadcrumb_icon_instance_var

Instance Method Details

#bulk_createObject

POST /admin/price_lists/:price_list_id/products/bulk_create.turbo_stream



16
17
18
19
20
21
22
# File 'app/controllers/spree/admin/price_list_products_controller.rb', line 16

def bulk_create
  @price_list.add_products(bulk_collection.pluck(:id))

  @collection = collection

  flash.now[:success] = Spree.t(:products_added)
end

#bulk_destroyObject

DELETE /admin/price_lists/:price_list_id/products/bulk_destroy.turbo_stream



25
26
27
28
# File 'app/controllers/spree/admin/price_list_products_controller.rb', line 25

def bulk_destroy
  @price_list.remove_products(bulk_collection.pluck(:id))
  flash.now[:success] = Spree.t(:products_removed)
end

#bulk_newObject

GET /admin/price_lists/:price_list_id/products/bulk_new



11
12
13
# File 'app/controllers/spree/admin/price_list_products_controller.rb', line 11

def bulk_new
  @currency = params[:currency] || current_store.default_currency
end