title: Organizing partials for a polymorphic resource
body: <p>I'm looking for how others typically organize their partials for a polymorphic resource.</p>
  
  <p>Example:</p>
  
  <p>I have <code>Image</code> which is polymorphic and depending on what is <code>imageable</code>, I want to display things slightly different.</p>
  
  <p>I have a partial <code>images/_image</code> and can call <code>render imageable.images</code>. My current mindset is to have my image partial check what type <code>imageable</code> is and then have another partial, specific to that case. My organization would be something along the lines of:</p>
  
  <pre><code>images/
    _image.html.haml
    _product.html.haml
    _post.html.haml
    _user.html.haml
  </code></pre>
  
  <p>My <code>_image</code> partial would look something like:</p>
  
  <pre><code>%div
    = render :partial =&gt; "images/#{imageable.type}"
  </code></pre>
  
  <p>Does this seem like a bad approach, or flat out the wrong approach? I think it would be much nicer to just call <code>render imageable.images</code> from anywhere than having to call <code>render :partial =&gt; ...</code> all over the place.</p>
  
  <p>Any ideas would be greatly appreciated. How have you done it?</p>
  
  <p>EDIT: A long time has gone by and I'm still wondering if anyone has any input on this. Throwing up a bounty to see if that draws some attention.</p>