Thanks for replies.

This:

post.blog_images.first.image_file_name

outputs

undefined method `image_file_name' for nil:NilClass

I think that means I called a method on a class that it cannot find? I 
have already established has_many belongs_to between blog_images and 
posts table.

This doesn't return error but doesn't output anything:

post.blog_images.map(&:image_file_name)

Although there are values in the image_file_name field of blog_images 
table. And if I was to hard code that value in url, it would work, so 
that map isn't doing what's expected of it.

ANy suggestions?

thanks for response.

-- 
Posted via http://www.ruby-forum.com/.

-- 
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.

Reply via email to