Class: Spree::Admin::ProductScopesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- BaseController
- Spree::Admin::ProductScopesController
- Defined in:
- app/controllers/spree/admin/product_scopes_controller.rb
Instance Method Summary collapse
Methods included from Core::ControllerHelpers
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/spree/admin/product_scopes_controller.rb', line 8 def create @product_group = ProductGroup.find_by_permalink(params[:product_group_id]) @product_scope = @product_group.product_scopes.build(params[:product_scope]) if @product_scope.save respond_with(@product_scope) do |format| format.html { redirect_to edit_admin_product_group_path(@product_group) } format.js { render :layout => false } end else respond_with(@product_scope) end end |
#destroy ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/controllers/spree/admin/product_scopes_controller.rb', line 21 def destroy @product_scope = ProductScope.find(params[:id]) if @product_scope.destroy @product_group = @product_scope.product_group @product_group.update_memberships respond_with(@product_scope) do |format| format.html { redirect_to edit_admin_product_group_path(@product_group) } format.js { render :layout => false } end else respond_with(@product_scope) do |format| format.html { redirect_to edit_admin_product_group_path(@product_scope.product_group) } end end end |