Skip to content

Instantly share code, notes, and snippets.

@tylr
Created August 4, 2010 20:53
Show Gist options
  • Save tylr/508779 to your computer and use it in GitHub Desktop.
Save tylr/508779 to your computer and use it in GitHub Desktop.
# Your Controller
def some_controller_action
ShitCan.skip_if_exists("#{params[:id]}_save_me") do
@blah = User.find_by_login(params[:id])
@items = Ass.timeline(@dj.id.to_s)
@items.some_cpu_heavy_command
end
end
# Your view
<% ShitCan.get_or_set "#{params[:id]}_save_me" do %>
<% @items.each do |item| %>
<li class="activity_feed_<%= item[1]['type'] %> clear">
<div class="feed_item_body">
<%= item.some.heavy.associations.lookup %>
</div>
</li>
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment