On 25 February 2011 21:02, John Merlino <[email protected]> wrote: >> That means that in your chain of method calls, the thing before >> "image_file_name" is nil. So there is no "first" record in the >> blog_images collection... are you sure you have some associated >> images? > > Yes, in my database I have blog_images table with a foreign key of > blog_post_id of 1. In my blog_posts table, I have a record with a > primary key of 1. So there should be at least one association.
Do you know how to use ruby-debug to break into your code and inspect data. If not have a look at the Rails Guide on debugging. Then you can break in before the problem line and inspect things to see what is the problem. Also you have not said what happens if you include the test checking for no blog_images. 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

