Sha256: a6d170664d4d4539af8abb50e276b5fe63253a55dec5938ea62b4171f1e24145

Contents?: true

Size: 456 Bytes

Versions: 2

Compression:

Stored size: 456 Bytes

Contents

class Dash::ProductsController < Dash::BaseController
  def new 
    @product = Product.new
    @options = Taxon.all
  end
  def create
    @product = current_user.supplier.products.build(params[:product])
    Taxon.all.map {|m| @product.taxons.push(Taxon.find_by_id(params[m.name])) if params.member?(m.name) }
    if @product.save
      redirect_to dash_overview_index_path, :notice => "New product created"
    else
      render "new"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_suppliers-0.0.1 app/controllers/dash/products_controller.rb
spree_suppliers-0.60.3 app/controllers/dash/products_controller.rb