When I put @user.dreams in my view, I get:
[# Dream id: 3, content: “My Dream”, user_id: 2, created_at: “2011-10-06 21:58:50”, updated_at: “2011-10-06 21:58:50″>]
Now I want to print out JUST the content: data from this row. But when I put:
@user.dreams.content or @user.content
I get the “undefined method `content’ error.
@user.id correctly prints out “2”.
How do I print out the “My Dream” content from this row?
if dreams is an association on user then you would need to do
or iterate through @user.dreams
eg