Class: Workarea::Admin::BulkActionSequentialProductEditsController
Instance Method Summary
collapse
#save_variant_on_product
#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
#edit ⇒ Object
11
12
13
|
# File 'app/controllers/workarea/admin/bulk_action_sequential_product_edits_controller.rb', line 11
def edit
render :publishing
end
|
#product ⇒ Object
27
28
|
# File 'app/controllers/workarea/admin/bulk_action_sequential_product_edits_controller.rb', line 27
def product
end
|
#publish ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/workarea/admin/bulk_action_sequential_product_edits_controller.rb', line 15
def publish
publish = SavePublishing.new(nil, params)
if publish.perform
self.current_release = publish.release
redirect_to first_product_path
else
flash[:error] = publish.errors.full_messages
render :publishing
end
end
|
#update_product ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'app/controllers/workarea/admin/bulk_action_sequential_product_edits_controller.rb', line 30
def update_product
set_details
set_filters
set_images
set_variants
if @product.update_attributes(params[:product])
if @bulk_action.last?
flash[:success] = t('workarea.admin.bulk_action_sequential_product_edits.flash_messages.done')
redirect_to catalog_products_path
else
flash[:success] = t('workarea.admin.bulk_action_sequential_product_edits.flash_messages.saved')
redirect_to next_product_path
end
else
flash[:error] = @product.errors.full_messages
render :product, status: :unprocessable_entity
end
end
|