Sha256: e99c7824ba0f7660c0df6e5193f81be2e53f71fb592bfe8cc8b16fecb0cfef13

Contents?: true

Size: 1.25 KB

Versions: 11

Compression:

Stored size: 1.25 KB

Contents

module Spree
  module Admin
    class ProductScopesController < BaseController
      helper 'spree/admin/product_groups'

      respond_to :html, :js

      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

      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

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spree_core-1.0.7 app/controllers/spree/admin/product_scopes_controller.rb
spree_core-1.0.6 app/controllers/spree/admin/product_scopes_controller.rb
spree_core-1.0.4 app/controllers/spree/admin/product_scopes_controller.rb
spree_core-1.0.3 app/controllers/spree/admin/product_scopes_controller.rb
spree_core-1.0.2 app/controllers/spree/admin/product_scopes_controller.rb
spree_core-1.0.1 app/controllers/spree/admin/product_scopes_controller.rb
spree_core-1.0.0 app/controllers/spree/admin/product_scopes_controller.rb
spree_core-1.0.0.rc4 app/controllers/spree/admin/product_scopes_controller.rb
spree_core-1.0.0.rc3 app/controllers/spree/admin/product_scopes_controller.rb
spree_core-1.0.0.rc2 app/controllers/spree/admin/product_scopes_controller.rb
spree_core-1.0.0.rc1 app/controllers/spree/admin/product_scopes_controller.rb