On 20 June 2011 17:53, joanne ta <[email protected]> wrote:
> I have other undefined method when i combine the code above together
>
> <%@users = User.all%>
> <%@users.each do |u|%>
> <%u.culture_id%>
>
>  <% @pic= Picture.where(:phrase_id => :route , :culture_id =>
> u.culture_id).first%>
>     <td>My picture <%= @pic.image%></td>
>
> and it causes undefined method image

What does it say has not got a method image?  It is always a good idea
to post the complete error message (use copy/paste rather than
re-typing it).  If it says the nil has not got the method then your
call of Picture.where has not found a record.

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.

Reply via email to