Simple. You get only one picture object (the first one) because you're using
.first method. Since you have only one object, you can't iterate over it
using the each loop. Get it?

Just use @user.image instead in the view :)

On Fri, Jun 10, 2011 at 9:46 AM, joanne <[email protected]> wrote:

> hi all,
>
> I have an error "undefined method `each' for #<Picture:0x927dea0>"
> what is that mean?
>
> in my view
> [code]
>
> <% @user.each do |p| %>
> <%= p.image %>
> <% end %>
>
> [/code]
>
>
> in controller
> [code]
>           @user=picture.all(
>                 :joins => :culture,
>                  :conditions => (Album.joins(:description))).first
>
> [/code]
>
>
> plz give me some advance
>
> --
> 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.
>
>

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

Reply via email to