app/controllers/products_controller.rb
def update
    add_dependent(params[:new_dependent])
    add_dependency(params[:new_dependency])
    new_product_service(params[:product_service])
    new_product_group_portfolio(params[:new_product_group_portfolios])
    new_product_portfolio(params[:new_product_portfolio])
    new_employee_product(params[:employee_product])
    new_portfolio(params[:new_portfolio])
    new_product_group(params[:new_product_group])
    if @product.update_attributes(params[:product])
      flash[:notice] = t(:product) + t(:updated)      
    else
      flash[:error] = t(:product) + t(:needs_a_name)
      @error = true
    end
    if @error.blank?
      redirect_to edit_product_path(@product.id)
    else
      render :edit
    end
  end
# Updates an existing product using info entered on the "edit" page
Updates an existing product using info entered on the "edit" page
Updates an existing product using info entered on the " edit " page
def update
    add_dependent(params[:new_dependent])
    add_dependency(params[:new_dependency])
    new_product_service(params[:product_service])
    new_product_group_portfolio(params[:new_product_group_portfolios])
    new_product_portfolio(params[:new_product_portfolio])
    new_employee_product(params[:employee_product])
    new_portfolio(params[:new_portfolio])
    new_product_group(params[:new_product_group])
    if @product.update_attributes(params[:product])
      flash[:notice] = t(:product) + t(:updated)      
    else
      flash[:error] = t(:product) + t(:needs_a_name)
      @error = true
    end
    if @error.blank?
      redirect_to edit_product_path(@product.id)
    else
      render :edit
    end
  end
def update add_dependent ( params [ :new_dependent ] ) add_dependency ( params [ :new_dependency ] ) new_product_service ( params [ :product_service ] ) new_product_group_portfolio ( params [ :new_product_group_portfolios ] ) new_product_portfolio ( params [ :new_product_portfolio ] ) new_employee_product ( params [ :employee_product ] ) new_portfolio ( params [ :new_portfolio ] ) new_product_group ( params [ :new_product_group ] ) if @product . update_attributes ( params [ :product ] ) flash [ :notice ] = t ( :product ) + t ( :updated ) else flash [ :error ] = t ( :product ) + t ( :needs_a_name ) @error = true end if @error . blank? redirect_to edit_product_path ( @product . id ) else render :edit end end
Updates an existing product using info entered on the "edit" page
Updates an existing product using info entered on the " edit " page