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