Great!!

when user_id is null (and can be null in some cases)

you can do this

<%post.each do |p|%>
     <%=p.user.name unless p.user.nil?%>
<%end>

other way is

<%=p.user.name unless p.user.empty?%>

2010/12/12 Colin Law <[email protected]>

> 2010/12/12 Rodrigo Mendonça <[email protected]>:
> > Search in app/model for the file User.rb (in singular)
> > This file exists??
>
> For posterity that should be user.rb not User.rb of course
>
> 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]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>


-- 
Rodrigo Mendonça
(62) 8567-3142

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