app/controllers/product_types_controller.rb
def update
    product_type = ProductType.find(params[:id])
    unless product_type.update_attributes(params[:product_type])
      flash[:error] = "Product type needs a unique name"
      render :index
      return
    end
    flash[:notice] = t(:settings) + t(:updated)
    redirect_to product_types_path
  end
# Updates a product type's name
Updates a product type's name
Updates a product type ' s name
def update
    product_type = ProductType.find(params[:id])
    unless product_type.update_attributes(params[:product_type])
      flash[:error] = "Product type needs a unique name"
      render :index
      return
    end
    flash[:notice] = t(:settings) + t(:updated)
    redirect_to product_types_path
  end
def update product_type = ProductType . find ( params [ :id ] ) unless product_type . update_attributes ( params [ :product_type ] ) flash [ :error ] = "Product type needs a unique name" render :index return end flash [ :notice ] = t ( :settings ) + t ( :updated ) redirect_to product_types_path end
Updates a product type's name
Updates a product type ' s name