Helpers
与使用查找上下文信息进行模板查找相关。
方法
- A
- D
- E
- F
- P
- T
属性
[R] | html_fallback_for_js | |
[R] | view_paths |
实例公共方法
any?(name, prefixes = [], partial = false) 链接
也称为: any_templates?
来源: 显示 | 在 GitHub 上
# File actionview/lib/action_view/lookup_context.rb, line 148 def any?(name, prefixes = [], partial = false) name, prefixes = normalize_name(name, prefixes) details, details_key = detail_args_for_any @view_paths.exists?(name, prefixes, partial, details, details_key, []) end
append_view_paths(paths) 链接
来源: 显示 | 在 GitHub 上
# File actionview/lib/action_view/lookup_context.rb, line 155 def append_view_paths(paths) @view_paths = build_view_paths(@view_paths.to_a + paths) end
exists?(name, prefixes = [], partial = false, keys = [], **options) 链接
也称为: template_exists?
来源: 显示 | 在 GitHub 上
# File actionview/lib/action_view/lookup_context.rb, line 141 def exists?(name, prefixes = [], partial = false, keys = [], **options) name, prefixes = normalize_name(name, prefixes) details, details_key = detail_args_for(options) @view_paths.exists?(name, prefixes, partial, details, details_key, keys) end
find(name, prefixes = [], partial = false, keys = [], options = {}) 链接
也称为: find_template
来源: 显示 | 在 GitHub 上
# File actionview/lib/action_view/lookup_context.rb, line 128 def find(name, prefixes = [], partial = false, keys = [], options = {}) name, prefixes = normalize_name(name, prefixes) details, details_key = detail_args_for(options) @view_paths.find(name, prefixes, partial, details, details_key, keys) end
find_all(name, prefixes = [], partial = false, keys = [], options = {}) 链接
来源: 显示 | 在 GitHub 上
# File actionview/lib/action_view/lookup_context.rb, line 135 def find_all(name, prefixes = [], partial = false, keys = [], options = {}) name, prefixes = normalize_name(name, prefixes) details, details_key = detail_args_for(options) @view_paths.find_all(name, prefixes, partial, details, details_key, keys) end
prepend_view_paths(paths) 链接
来源: 显示 | 在 GitHub 上
# File actionview/lib/action_view/lookup_context.rb, line 159 def prepend_view_paths(paths) @view_paths = build_view_paths(paths + @view_paths.to_a) end
实例私有方法
detail_args_for(options) 链接
根据用户选项(例如从渲染传递)计算详细信息哈希和键。
来源: 显示 | 在 GitHub 上
# File actionview/lib/action_view/lookup_context.rb, line 175 def detail_args_for(options) # :doc: return @details, details_key if options.empty? # most common path. user_details = @details.merge(options) if @cache details_key = DetailsKey.details_cache_key(user_details) else details_key = nil end [user_details, details_key] end