On Sep 15, 2009, at 5:45 PM, blueHandTalking wrote: > The following is what I have used to see if id has been saved, but it > does not work: > > @photo = Photo.find(params[:id]) > if @photo.id != nil > @photo.update_attributes(params[:photo]) > else > @photo = Photo.new(params[:photo] > end
If you found it with Photo.find(params[:id]), it had better have an id, in particular an id == params[:id]. Objects that are created but not yet saved in another controller won't be visible to anybody... --Matt Jones --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/hobousers?hl=en -~----------~----~----~----~------~----~------~--~---
