2011/6/7 Jeweller <jiangna...@gmail.com>:
> Well, I think Fred may be right. The path to my app contains some
> Chinese, like "桌面". So I removed it to another directory, but there
> came with a new error "undefined method `name' for nil:NilClass"
> instead of the old one.

As I asked previously, don't top post.  Thanks.

>
> comment.commenter is a nilclass !!!    but <%= comment.commenter %> it
> got #<User:0xa86725c>

I think you must be mistaken, it cannot both be nil and User at the
same time.  As fred suggested, maybe some are ok and others are nil.
Try using something like
<%= comment.commenter.name if comment.commenter %>
Also have a look at the Rails Guide on debugging.  It will show you
how to use ruby-debug to break into your code and inspect data and
follow flow.

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