Class: Workarea::Admin::CatalogProductCopiesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/admin/catalog_product_copies_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user, #find_sort, #wrap_in_view_model, wrap_in_view_model

Methods included from Publishing

#allow_publishing!, #allow_publishing?, #set_publishing_options

Methods included from Visiting

#most_visited

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/workarea/admin/catalog_product_copies_controller.rb', line 10

def create
  @product_copy =
    CopyProduct.new(@product, params[:product].to_unsafe_h).perform

  if @product_copy.persisted?
    flash[:success] = t('workarea.admin.catalog_product_copies.flash_messages.created')
    redirect_to edit_create_catalog_product_path(@product_copy, continue: true)
  else
    flash[:error] = t('workarea.admin.catalog_product_copies.flash_messages.error')
    render :new
  end
end

#newObject



7
8
# File 'app/controllers/workarea/admin/catalog_product_copies_controller.rb', line 7

def new
end