Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
333ecdcb
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
333ecdcb
编写于
5月 08, 2015
作者:
G
Gourav Tiwari
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Better formatted documents [ci skip]
上级
9c290fbe
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
8 deletion
+12
-8
actionview/lib/action_view/helpers/cache_helper.rb
actionview/lib/action_view/helpers/cache_helper.rb
+12
-8
未找到文件。
actionview/lib/action_view/helpers/cache_helper.rb
浏览文件 @
333ecdcb
...
...
@@ -75,7 +75,8 @@ module CacheHelper
# render(topics) => render("topics/topic")
# render(message.topics) => render("topics/topic")
#
# It's not possible to derive all render calls like that, though. Here are a few examples of things that can't be derived:
# It's not possible to derive all render calls like that, though.
# Here are a few examples of things that can't be derived:
#
# render group_of_attachments
# render @project.documents.where(published: true).order('created_at')
...
...
@@ -97,19 +98,21 @@ module CacheHelper
# <%# Template Dependency: todolists/todolist %>
# <%= render_sortable_todolists @project.todolists %>
#
# The pattern used to match these is /# Template Dependency: ([^ ]+)/, so it's important that you type it out just so.
# The pattern used to match these is /# Template Dependency: ([^ ]+)/,
# so it's important that you type it out just so.
# You can only declare one template dependency per line.
#
# === External dependencies
#
# If you use a helper method, for example, inside of a cached block and you then update that helper,
# you'll have to bump the cache as well. It doesn't really matter how you do it, but the md5 of the template file
# If you use a helper method, for example, inside a cached block and
# you then update that helper, you'll have to bump the cache as well.
# It doesn't really matter how you do it, but the md5 of the template file
# must change. One recommendation is to simply be explicit in a comment, like:
#
# <%# Helper Dependency Updated: May 6, 2012 at 6pm %>
# <%= some_helper_method(person) %>
#
# Now all you
'll
have to do is change that timestamp when the helper method changes.
# Now all you have to do is change that timestamp when the helper method changes.
#
# === Automatic Collection Caching
#
...
...
@@ -118,7 +121,7 @@ module CacheHelper
# <%= render @notifications %>
# <%= render partial: 'notifications/notification', collection: @notifications %>
#
# If the notifications/_notification partial starts with a cache call
like so
:
# If the notifications/_notification partial starts with a cache call
as
:
#
# <% cache notification do %>
# <%= notification.name %>
...
...
@@ -127,8 +130,9 @@ module CacheHelper
# The collection can then automatically use any cached renders for that
# template by reading them at once instead of one by one.
#
# See ActionView::Template::Handlers::ERB.resource_cache_call_pattern for more
# information on what cache calls make a template eligible for this collection caching.
# See ActionView::Template::Handlers::ERB.resource_cache_call_pattern for
# more information on what cache calls make a template eligible for this
# collection caching.
#
# The automatic cache multi read can be turned off like so:
#
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录