Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix up alignment

  • Loading branch information...
commit 447443087aa477e7b65e399789dcf093a31ad17c 1 parent 6890976
Charlie Somerville authored
Showing with 9 additions and 3 deletions.
  1. +5 −2 views/blog.erb
  2. +4 −1 views/blog_all.erb
7 views/blog.erb
View
@@ -1,10 +1,13 @@
<%== erb :_post, locals: { post: @posts.first, abbreviated: true } %>
<ul class="previous-posts">
- <% @posts.drop(1).each do |post| %>
+ <% @posts.drop(1).each_with_index do |post, index| %>
<li>
<h3><a href="<%= post_path post %>"><%= post.title %></a></h3>
<span><%= post.created_at %></span>
- </li>
+ </li>
+ <% if index.odd? %>
+ <div style="clear:both;"></div>
+ <% end %>
<% end %>
</ul>
5 views/blog_all.erb
View
@@ -2,7 +2,7 @@
<h3>Past Posts</h3>
<ul>
- <% @posts.each do |post| %>
+ <% @posts.each_with_index do |post, index| %>
<li>
<div class="masthead">
<h4>
@@ -13,6 +13,9 @@
</span>
</div>
</li>
+ <% if index.odd? %>
+ <div style="clear:both;"></div>
+ <% end %>
<% end %>
</ul>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.