Skip to content

Instantly share code, notes, and snippets.

@benburkert
Created September 22, 2008 07:04
Show Gist options
  • Save benburkert/11955 to your computer and use it in GitHub Desktop.
Save benburkert/11955 to your computer and use it in GitHub Desktop.
## index.html.haml
[email protected] do |user|
-fetch_partial :short, :object => user # generated key should be "users/_short.html--object=#{user.to_param}"
## admins.html.haml
-fetch_fragment :count => User.admins.count do # key should be "path__to__admins__html__haml-1--count=#{User.admins.count}"
%ul
-User.admins.each do |admin|
%li=link_to(admin.name, url(:admin, admin))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment