Rails Rails 4 中的片段缓存怎么过期?

jeky · November 25, 2014 · Last by ensonmj replied at November 25, 2014 · 1622 hits

我正在学习 Rails4 中的片段缓存: http://guides.ruby-china.org/caching_with_rails.html

测试了一下,发现无法通过 expire_fragment 方法清除缓存, 是哪里写错了吗?(代码在下方)

———— 模板 helper

<% cache(action:'t4', action_suffix: 'time') do %>
片段缓存:<%=Time.now%> <% end %>

———— 清理缓存的 action

def clean expire_fragment(action: 't4', action_suffix: 'time') render plain: 'ok' end

另外,我想再问一下,除了《Rails guides》之外,还有什么资料可以研究的? 我现在想系统的学习一些 Rails4 知识。

You need to Sign in before reply, if you don't have an account, please Sign up first.