All pastes #839024 Raw Edit

Stuff

public ruby v1 · immutable
#839024 ·published 2007-12-30 20:22 UTC
rendered paste body
  def create    @product = Product.new(params[:product])    @product.company = current_user.companies.find(params[:company_id])    respond_to do |format|      if @product.save        flash[:notice] = 'Product was successfully created.'        format.html {redirect_to(my_company_path(@product.company)) }        format.xml  {render(:xml => @product, :status => :created, :location => @product)}      else        format.html {CompaniesController.new.show} #{render(:action => "new")}        format.xml  {render(:xml => @product.errors, :status => :unprocessable_entity)}      end    end  end