On Apr 20, 2005, at 12:23 PM, Leonardo Francalanci wrote:
> Can I update an object without "finding" it?
> I mean I think that
>
> @outing = Outing.find(@params[:id])
> if @outing.update_attributes(@params[:outing])
> ...
>
> will select the Outing object from the db and then update it. But
> suppose I want to update the object without selecting it (and knowing
> that all the properties of my object are in "@params[:outing]").
Could
> I do it?
>
>
Outing.update(@params[:id], @params[:outing])
Should do what you want.
-Scott
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails