You have a nil object when you didn't expect it!

Forums > Book - Chapter 5 > You have a nil object when you didn't expect it!

Login to post a new topic

Author Message
nzkronic
Member since 31 Aug 04:38
0 posts

Hi, I have this error when trying to reply to a post:
You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.name
Extracted source (around line #3):
1: h2>New Post
2: <= error_messages_for :post ->
3:

Topic: <= @topic.name %>


4: < form_for :post, :url => forum_topic_posts_path(:forum_id => @topic.forum,
5: :topic_id => @topic) do |f| ->
6:

Message:
<= f.text_area :body, :rows => 8, :cols => 60 -%>


I have searched through my controller files but cant seem to find the problem, any ideas?