Helpers related to template lookup using the lookup context information.
Methods
- A
- D
- E
- F
- T
- V
- W
Attributes
[R] | html_fallback_for_js | |
[R] | view_paths |
Instance Public methods
exists?(name, prefixes = [], partial = false, keys = [], **options)
Link
Also aliased as: template_exists?
find(name, prefixes = [], partial = false, keys = [], options = {})
Link
Also aliased as: find_template
find_all(name, prefixes = [], partial = false, keys = [], options = {})
Link
find_file(name, prefixes = [], partial = false, keys = [], options = {})
Link
template_exists?(name, prefixes = [], partial = false, keys = [], **options)
Link
Alias for: exists?
view_paths=(paths)
Link
Whenever setting view paths, makes a copy so that we can manipulate them in instance objects as we wish.
with_fallbacks()
Link
Adds fallbacks to the view paths. Useful in cases when you are rendering a :file.
# File actionview/lib/action_view/lookup_context.rb, line 140 def with_fallbacks added_resolvers = 0 self.class.fallbacks.each do |resolver| next if view_paths.include?(resolver) view_paths.push(resolver) added_resolvers += 1 end yield ensure added_resolvers.times { view_paths.pop } end
Instance Private methods
detail_args_for(options)
Link
Compute details hash and key according to user options (e.g. passed from render).
# File actionview/lib/action_view/lookup_context.rb, line 161 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.get(user_details) else details_key = nil end [user_details, details_key] end