Sha256: 4184fe28025f79fe34ede21a3511d6e553e83c0ca10921be2bbce179f81cceab

Contents?: true

Size: 828 Bytes

Versions: 11

Compression:

Stored size: 828 Bytes

Contents

module Spree
  module Admin
    class PrototypesController < ResourceController
      after_filter :set_habtm_associations, :only => [:create, :update]

      helper 'spree/admin/product_properties'

      def available
        @prototypes = Prototype.order('name asc')
        respond_with(@prototypes) do |format|
          format.html { render :layout => !request.xhr? }
          format.js
        end
      end

      def select
        @prototype ||= Prototype.find(params[:id])
        @prototype_properties = @prototype.properties

        respond_with(@prototypes)
      end

      private
  
      def set_habtm_associations
        @prototype.property_ids = params[:property][:id] if params[:property]
        @prototype.option_type_ids = params[:option_type][:id] if params[:option_type]
      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/prototypes_controller.rb
spree_core-1.0.6 app/controllers/spree/admin/prototypes_controller.rb
spree_core-1.0.4 app/controllers/spree/admin/prototypes_controller.rb
spree_core-1.0.3 app/controllers/spree/admin/prototypes_controller.rb
spree_core-1.0.2 app/controllers/spree/admin/prototypes_controller.rb
spree_core-1.0.1 app/controllers/spree/admin/prototypes_controller.rb
spree_core-1.0.0 app/controllers/spree/admin/prototypes_controller.rb
spree_core-1.0.0.rc4 app/controllers/spree/admin/prototypes_controller.rb
spree_core-1.0.0.rc3 app/controllers/spree/admin/prototypes_controller.rb
spree_core-1.0.0.rc2 app/controllers/spree/admin/prototypes_controller.rb
spree_core-1.0.0.rc1 app/controllers/spree/admin/prototypes_controller.rb