Class: Spree::Admin::ProductImportsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/admin/product_imports_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



13
14
15
16
17
18
# File 'app/controllers/spree/admin/product_imports_controller.rb', line 13

def create
  @product_imports = spree_current_user.product_imports.create(product_import_params)
  ImportProductsJob.perform_later(@product_imports)
  flash[:notice] = t('product_import_processing')
  redirect_to admin_product_imports_path
end

#destroyObject



20
21
22
23
24
25
26
# File 'app/controllers/spree/admin/product_imports_controller.rb', line 20

def destroy
  @product_import = Spree::ProductImport.find(params[:id])
  if @product_import.destroy
    flash[:success] = t('delete_product_import_successful')
  end
  redirect_to admin_product_imports_path
end

#indexObject



4
5
6
# File 'app/controllers/spree/admin/product_imports_controller.rb', line 4

def index
  @product_import = Spree::ProductImport.new
end

#showObject



8
9
10
11
# File 'app/controllers/spree/admin/product_imports_controller.rb', line 8

def show
  @product_import = Spree::ProductImport.find(params[:id])
  @products = @product_import.products
end