Module: ActionView::LookupContext::ViewPaths

Included in:
ActionView::LookupContext
Defined in:
lib/action_view/lookup_context.rb

Overview

Helpers related to template lookup using the lookup context information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#html_fallback_for_jsObject (readonly)

Returns the value of attribute html_fallback_for_js.



122
123
124
# File 'lib/action_view/lookup_context.rb', line 122

def html_fallback_for_js
  @html_fallback_for_js
end

#view_pathsObject (readonly)

Returns the value of attribute view_paths.



122
123
124
# File 'lib/action_view/lookup_context.rb', line 122

def view_paths
  @view_paths
end

Instance Method Details

#any?(name, prefixes = [], partial = false) ⇒ Boolean Also known as: any_templates?

Returns:

  • (Boolean)


144
145
146
147
148
# File 'lib/action_view/lookup_context.rb', line 144

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

#exists?(name, prefixes = [], partial = false, keys = [], **options) ⇒ Boolean Also known as: template_exists?

Returns:

  • (Boolean)


137
138
139
140
141
# File 'lib/action_view/lookup_context.rb', line 137

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 = {}) ⇒ Object Also known as: find_template



124
125
126
127
128
# File 'lib/action_view/lookup_context.rb', line 124

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 = {}) ⇒ Object



131
132
133
134
135
# File 'lib/action_view/lookup_context.rb', line 131

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