Sha256: fb99eb8db2947113753f3e6f77eba36ddc36b341f76b1ba47ea746055e6caa5b

Contents?: true

Size: 714 Bytes

Versions: 10

Compression:

Stored size: 714 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? }
      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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_core-0.70.7 app/controllers/admin/prototypes_controller.rb
spree_core-0.70.6 app/controllers/admin/prototypes_controller.rb
spree_core-0.70.5 app/controllers/admin/prototypes_controller.rb
spree_core-0.70.4 app/controllers/admin/prototypes_controller.rb
spree_core-0.70.3 app/controllers/admin/prototypes_controller.rb
spree_core-0.70.2 app/controllers/admin/prototypes_controller.rb
spree_core-0.70.1 app/controllers/admin/prototypes_controller.rb
spree_core-0.70.0 app/controllers/admin/prototypes_controller.rb
spree_core-0.70.0.rc2 app/controllers/admin/prototypes_controller.rb
spree_core-0.70.RC1 app/controllers/admin/prototypes_controller.rb