Created
October 14, 2009 23:42
-
-
Save mpen/210500 to your computer and use it in GitHub Desktop.
Rails yield / content_for
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<%= yield :head %> | |
</head> | |
<body> | |
<%= yield %> | |
<%= yield :javascript %> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% content_for :head do %> | |
<%= stylesheet_link_tag 'style' %> | |
<% end %> | |
<% content_for :javascript do %> | |
<%= javascript_include_tag 'prototype' %> | |
<% end %> | |
<% content_for :javascript do %> | |
<% javascript_tag do %> | |
alert('...') | |
<% end %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment