title: Rails: about yield
body: <p>I saw some code in a <strong>Rails v2.3</strong> app. </p>
  
  <p>In <code>layout/car_general.html.erb</code> (this view is called by a method in cars_controller) , I saw the code:</p>
  
  <pre><code>&lt;body&gt;
      &lt;%= yield %&gt;
  
      &lt;%= javascript_include_tag 'jquery-1.4.2.min' %&gt;
  
      &lt;% javascript_tag do %&gt;
        &lt;%= yield :jstemplates %&gt;
            var some_car = new Object;
        &lt;%= yield :some_car %&gt;
      &lt;% end -%&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Two questions to ask:</p>
  
  <ol>
  <li>Where can I find the yield content of the first &lt;%=yield%> under <code>&lt;body&gt;</code>. </li>
  <li>Is it a rails specific way to include js code in a view by using 
  <code>&lt;%= yield :jstemplates %&gt;</code> and what about <code>&lt;%= yield :some_car %&gt;</code> , is it point to a view or just to show the value of <code>some_car</code>?</li>
  </ol>