If your application is usually something like:
<html>
<head>
<%= stylesheet_link_tag 'application' -%>
<%= javascript_include_tag 'yui', 'application' -%>
</head>
<body>
<%= yield -%>
</body>
</html>
You can add other crop blocks, wherever you want, name whatever you want. I usually used this to include features specific to each page, wherever I wanted, even to the extent that perhaps partial deliveries deliver their own.
<html>
<head>
<%= stylesheet_link_tag 'application' -%>
<%= javascript_include_tag 'yui', 'application' -%>
<%= yield :head -%>
</head>
<body>
<%= yield -%>
</body>
</html>
<%= title("#{@user.name} Profile") -%>
<% content_for :head do -%>
<%= javascript_include_tag 'gallery' %>
<% end %>
<%= render @user.photos %>
So, etc ...
source
share