def update @product = Product.find(params[:id]) if @product.update_attributes(params[:product]) flash[:notice] = 'Product was successfully updated.' redirect_to :action => 'show', :id => @product else render :action => 'edit' end end