On 10 February 2011 16:02, Mauro <mrsan...@gmail.com> wrote: > On 10 February 2011 09:56, Mauro <mrsan...@gmail.com> wrote: >> On 10 February 2011 09:54, Michael Pavling <pavl...@gmail.com> wrote: >>> On 10 February 2011 09:51, Peter Hickman <peterhickman...@googlemail.com> >>> wrote: >>>>On 10 February 2011 09:37, Mauro >>>>> Can't I test if an object is saved or not in the database? >>>> >>>> Well an unsaved object will have an id of nil. >>> >>> or you can use the ".new_record?" method. >>> >> >> I'll try soon. > > It' s not the solution. > After I've saved @document and @delivery I go to show action where I > have @delivery=Delivery.new and @document=Document.new, so new_record > is always true.
In the show action you should be finding the records in the database, not making new ones. Otherwise how are you going to show them? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.