title: ruby-on-rails: rendering partials on each item in a list
body: <p>I have the following in a view (.html.erb) :</p>
  
  <pre><code>&lt;% @posts = GetAllPostsFunctions %&gt;   (removed for berivity)
  
  &lt;% @posts.each do |post| %&gt;
  &lt;%=  post.title %&gt;
  
  &lt;%= render :partial =&gt; "posts/post_show" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>the posts_show partial has the following:</p>
  
  <pre><code>....
  &lt;td&gt;&lt;%=h @post.title %&gt; &lt;/td&gt;
  </code></pre>
  
  <p>But I get the following error</p>
  
  <pre><code>You have a nil object when you didn't expect it!
  The error occurred while evaluating nil.title
  </code></pre>
  
  <p>Any ideas? </p>