Class: Spree::Admin::ProductsController
Instance Attribute Summary
#title
Instance Method Summary
collapse
belongs_to, create, #create, destroy, #edit, #new, new_action, update, #update
#associate_user, included, #try_spree_current_user
Instance Method Details
#clone ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
|
# File 'app/controllers/spree/admin/products_controller.rb', line 34
def clone
@new = @product.duplicate
if @new.save
flash.notice = I18n.t('notice_messages.product_cloned')
else
flash.notice = I18n.t('notice_messages.product_not_cloned')
end
respond_with(@new) { |format| format.html { redirect_to edit_admin_product_url(@new) } }
end
|
#destroy ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
|
# File 'app/controllers/spree/admin/products_controller.rb', line 22
def destroy
@product = Product.where(:permalink => params[:id]).first!
@product.delete
flash.notice = I18n.t('notice_messages.product_deleted')
respond_with(@product) do |format|
format.html { redirect_to collection_url }
format.js { render_js_for_destroy }
end
end
|
#index ⇒ Object
15
16
17
18
19
20
|
# File 'app/controllers/spree/admin/products_controller.rb', line 15
def index
respond_with(@collection) do |format|
format.html
format.json { render :json => json_data }
end
end
|
#show ⇒ Object
11
12
13
|
# File 'app/controllers/spree/admin/products_controller.rb', line 11
def show
redirect_to( :action => :edit )
end
|