title: Rails: Render a View (not a partial) From Within a View
body: <p>I have a controller that responds to both <code>html</code> and <code>js</code>. The <code>html</code> view renders the whole page (including the header and footer), while the <code>js</code> only replaces <code>#main</code>. Aside from the header and footer, both formats render the same content. I can get this effect with three files:</p>
  
  <pre><code>_show.html.erb
  &lt;div&gt;Content!&lt;/div&gt;
  
  show.html.erb
  &lt;%= render "show" %&gt;
  
  show.js.erb
  $("#main").fadeIn("&lt;%= escape_javascript(render 'show') %&gt;");
  </code></pre>
  
  <p>This works, but I'd prefer if I didn't need a separate <code>_show</code> partial. Unfortunately, this doesn't work:</p>
  
  <pre><code>show.html.erb
  &lt;div&gt;Content!&lt;/div&gt;
  
  show.js.erb
  $("#main").fadeIn("&lt;%= escape_javascript(render 'show') %&gt;");
  </code></pre>
  
  <p>As Rails will look for the <code>show</code> partial, not the actual view.</p>
  
  <p>Is there a way to get Rails to look for the view file, rather than a partial?</p>