title: Is there any Rails function to check if a partial exists?
body: <p>When I render a partial which does not exists, I get an Exception. I'd like to check if a partial exists before rendering it and in case it doesn't exist, I'll render something else. I did the following code in my .erb file, but I think there should be a better way to do this:</p>
  
  <pre><code>    &lt;% begin %&gt;
        &lt;%= render :partial =&gt; "#{dynamic_partial}" %&gt;
      &lt;% rescue ActionView::MissingTemplate %&gt;
        Can't show this data!
      &lt;% end %&gt;
  </code></pre>