Skip to content

Commit

Permalink
Building a Layout file to keep things DRY
Browse files Browse the repository at this point in the history
  • Loading branch information
knowtheory committed Mar 9, 2011
1 parent 5846da2 commit 4220b84
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
14 changes: 14 additions & 0 deletions views/layout.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<head>
<style>
.main{ width:800px; margin:100px auto;}
ul{list-style:none; margin:0px; padding:0px; }
li{float:left; margin: 10px; width: 150px; height: 200px; padding:0px;}
</style>
</head>
<body>
<div class="main">
<%= yield %>
</div>
</body>
</html>
6 changes: 1 addition & 5 deletions views/session.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
<html>
<body>
<h1><%= session.name %></h1>
</body>
</html>
<h1><%= session.name %></h1>
16 changes: 6 additions & 10 deletions views/speakers.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<html>
<body>
<h1>Speakers</h1>
<dl>
<% speakers.each do |speaker| %>
<dt><a href="<%= url("speakers/#{speaker.id}")%>"><%= speaker.name %></a></dt><dd><%= speaker.affiliation %></dd>
<% end %>
</dl>
</body>
</html>
<h1>Speakers</h1>
<ul>
<% speakers.each do |speaker| %>
<li><img src="<%= speaker.photo_url %>"/><p><a href="<%= url("speakers/#{speaker.id}")%>"><%= speaker.name %></a></p><p><%= speaker.affiliation || "&nbsp;" %></p></li>
<% end %>
</ul>

0 comments on commit 4220b84

Please sign in to comment.