rails 3 caching: expire action for named route

前端 未结 3 821
北荒
北荒 2021-01-05 14:38

My controller has this:

caches_action :render_ticker_for_channel, :expires_in => 30.seconds

In my routes file I have this:



        
3条回答
  •  春和景丽
    2021-01-05 15:03

    caches_action :render_ticker_for_channel, :if => proc do 
      !!params['doCache']
    end
    

    But for this solution to work we need to pass an extra param either through query string or post body.

提交回复
热议问题