title: Passing parameters to partial view
body: <p>I have a view that displays multiple images and those images' associated tags. I decided to use a partial view for each image and its tags, but I am having trouble passing in the image object into the partial view. Here is the main view's relevant code:</p>
  
  <pre><code>&lt;table&gt;
    &lt;% @images.each do |i| %&gt;
      &lt;tr&gt;
        &lt;%= render :partial =&gt; :image_tag, :image =&gt; i %&gt;
      &lt;/tr&gt;
    &lt;% end %&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Here is the partial view's relevant code (partial view is named _image_tag.html.erb):</p>
  
  <pre><code>&lt;table&gt;
    &lt;%= image.id %&gt;
    &lt;%= image_tag image.src %&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I read in <a href="https://stackoverflow.com/questions/4700617/pass-an-variable-into-a-partial-rails-3">this</a> thread that I can pass in the image object the way that I am currently doing it. I tried passing in the id through an options hash on the render method, and that also didn't work. The error I am getting is:</p>
  
  <pre><code>undefined method `model_name' for Symbol:Class
  </code></pre>
  
  <p>centered around the line where I am calling render :partial in the main view.</p>