public
Created

Fragment caching applied

  • Download Gist
cache_example.html.erb
HTML+ERB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<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>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.