Skip to content

Instantly share code, notes, and snippets.

@tkosuga
Created May 4, 2013 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkosuga/5517672 to your computer and use it in GitHub Desktop.
Save tkosuga/5517672 to your computer and use it in GitHub Desktop.
hokkaido-photo.tkosuga.jpのページキャッシュ部分
caches_action :index, :cache_path => :cache_path.to_proc, :expires_in => 2.hours
caches_action :spring, :cache_path => :cache_path.to_proc, :expires_in => 2.hours
caches_action :summer, :cache_path => :cache_path.to_proc, :expires_in => 2.hours
caches_action :autumn, :cache_path => :cache_path.to_proc, :expires_in => 2.hours
caches_action :winter, :cache_path => :cache_path.to_proc, :expires_in => 2.hours
def cache_path
controller_name + "/" + action_name + "?page=" + (params[:page] || 1).to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment