Sha256: 8b220f2cf098d29e1e1942aa2c9e6796afc9b9126a8338c37592dfb52bf703a0

Contents?: true

Size: 698 Bytes

Versions: 13

Compression:

Stored size: 698 Bytes

Contents

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

  helper 'admin/product_properties'

  def available
    @prototypes = Prototype.order('name asc')
    respond_with(@prototypes) do |format|
      format.html { render :layout => !request.xhr? }
    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

Version data entries

13 entries across 13 versions & 6 rubygems

Version Path
apispree_core-0.0.0 app/controllers/admin/prototypes_controller.rb
My-Commerce_core-1.1.0 app/controllers/admin/prototypes_controller.rb
My-Commerce_core-1.0.0 app/controllers/admin/prototypes_controller.rb
MyCommerceapi-1.0.0 core/app/controllers/admin/prototypes_controller.rb
MyCommerce-0.0.3 core/app/controllers/admin/prototypes_controller.rb
rfcommerce_core-0.0.3 app/controllers/admin/prototypes_controller.rb
spree_core-0.60.6 app/controllers/admin/prototypes_controller.rb
spree_core-0.60.5 app/controllers/admin/prototypes_controller.rb
spree_core-0.60.4 app/controllers/admin/prototypes_controller.rb
spree_core-0.60.3 app/controllers/admin/prototypes_controller.rb
spree_core-0.60.2 app/controllers/admin/prototypes_controller.rb
spree_core-0.60.1 app/controllers/admin/prototypes_controller.rb
spree_core-0.60.0 app/controllers/admin/prototypes_controller.rb