From 191ddf26379670b477bd63bccf8debbe16d20ed9 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Sat, 22 Sep 2012 19:42:40 -0500 Subject: update AC::Caching documentation [ci skip] --- .../lib/action_controller/caching/actions.rb | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'actionpack/lib/action_controller/caching/actions.rb') diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb index eb3aa05a25..bf16fe267c 100644 --- a/actionpack/lib/action_controller/caching/actions.rb +++ b/actionpack/lib/action_controller/caching/actions.rb @@ -1,16 +1,16 @@ require 'set' -module ActionController #:nodoc: +module ActionController module Caching # Action caching is similar to page caching by the fact that the entire # output of the response is cached, but unlike page caching, every # request still goes through Action Pack. The key benefit of this is # that filters run before the cache is served, which allows for # authentication and other restrictions on whether someone is allowed - # to execute such action. Example: + # to execute such action. # # class ListsController < ApplicationController - # before_filter :authenticate, :except => :public + # before_filter :authenticate, except: :public # # caches_page :public # caches_action :index, :show @@ -35,8 +35,8 @@ module ActionController #:nodoc: # http://david.example.com/lists.xml # are treated like separate requests and so are cached separately. # Keep in mind when expiring an action cache that - # :action => 'lists' is not the same as - # :action => 'list', :format => :xml. + # action: 'lists' is not the same as + # action: 'list', format: :xml. # # You can modify the default action cache path by passing a # :cache_path option. This will be passed directly to @@ -53,18 +53,18 @@ module ActionController #:nodoc: # The following example depicts some of the points made above: # # class ListsController < ApplicationController - # before_filter :authenticate, :except => :public + # before_filter :authenticate, except: :public # # caches_page :public # - # caches_action :index, :if => Proc.new do + # caches_action :index, if: Proc.new do # !request.format.json? # cache if is not a JSON request # end # - # caches_action :show, :cache_path => { :project => 1 }, - # :expires_in => 1.hour + # caches_action :show, cache_path: { project: 1 }, + # expires_in: 1.hour # - # caches_action :feed, :cache_path => Proc.new do + # caches_action :feed, cache_path: Proc.new do # if params[:user_id] # user_list_url(params[:user_id, params[:id]) # else @@ -73,7 +73,7 @@ module ActionController #:nodoc: # end # end # - # If you pass :layout => false, it will only cache your action + # If you pass layout: false, it will only cache your action # content. That's useful when your layout has dynamic information. # # Warning: If the format of the request is determined by the Accept HTTP @@ -162,9 +162,9 @@ module ActionController #:nodoc: class ActionCachePath attr_reader :path, :extension - # If +infer_extension+ is true, the cache path extension is looked up from the request's + # If +infer_extension+ is +true+, the cache path extension is looked up from the request's # path and format. This is desirable when reading and writing the cache, but not when - # expiring the cache - expire_action should expire the same files regardless of the + # expiring the cache - +expire_action+ should expire the same files regardless of the # request format. def initialize(controller, options = {}, infer_extension = true) if infer_extension -- cgit v1.2.3