Skip to content

Instantly share code, notes, and snippets.

@andyhawthorne
Created September 11, 2012 21:42
Show Gist options
  • Save andyhawthorne/3702298 to your computer and use it in GitHub Desktop.
Save andyhawthorne/3702298 to your computer and use it in GitHub Desktop.
Fragment caching applied
<table>
<% cache do %>
<% @posts.each do |post| %>
<tr>
<td><strong><%= post.title %></strong></td>
</tr>
<tr>
<td><em>Posted: <%= post.created_at.strftime('%a %d %B %Y - %H:%M') %></em></td>
</tr>
<tr>
<td><%= post.content %>... [ <%= link_to 'Read Post', post %> ]</td>
</tr>
<% end %>
<% end %>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment