-
-
Save mikker/1025021 to your computer and use it in GitHub Desktop.
Nested layouts in Rails
This file contains hidden or 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
<div id="header">...</div> | |
<%= yield %> | |
<div id="footer">...</div> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Site</title> | |
</head> | |
<body> | |
<%= render(:layout => 'layouts/page') { yield } %> | |
</body> | |
</html> |
This file contains hidden or 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
<h1>Listing projects</h1> | |
<table id="projects"> | |
<tr> | |
<th>Name</th> | |
<th></th> | |
</tr> | |
<% @projects.each do |project| %> | |
<tr> | |
<td><%= link_to project.name, project %></td> | |
<td><%= link_to 'Destroy', project, :confirm => 'Are you sure?', :method => :delete %></td> | |
</tr> | |
<% end %> | |
</table> | |
<br /> | |
<%= link_to 'New Project', new_project_path %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment