Class Index [+]

Quicksearch

ActionView::LookupContext::ViewPaths

Helpers related to template lookup using the lookup context information.

Attributes

view_paths[R]

Public Instance Methods

exists?(name, prefixes = [], partial = false, keys = [], options = {}) click to toggle source
     # File lib/action_view/lookup_context.rb, line 117
117:       def exists?(name, prefixes = [], partial = false, keys = [], options = {})
118:         @view_paths.exists?(*args_for_lookup(name, prefixes, partial, keys, options))
119:       end
Also aliased as: template_exists?
find(name, prefixes = [], partial = false, keys = [], options = {}) click to toggle source
     # File lib/action_view/lookup_context.rb, line 108
108:       def find(name, prefixes = [], partial = false, keys = [], options = {})
109:         @view_paths.find(*args_for_lookup(name, prefixes, partial, keys, options))
110:       end
Also aliased as: find_template
find_all(name, prefixes = [], partial = false, keys = [], options = {}) click to toggle source
     # File lib/action_view/lookup_context.rb, line 113
113:       def find_all(name, prefixes = [], partial = false, keys = [], options = {})
114:         @view_paths.find_all(*args_for_lookup(name, prefixes, partial, keys, options))
115:       end
find_template(name, prefixes = [], partial = false, keys = [], options = {}) click to toggle source
Alias for: find
template_exists?(name, prefixes = [], partial = false, keys = [], options = {}) click to toggle source
Alias for: exists?
view_paths=(paths) click to toggle source

Whenever setting view paths, makes a copy so we can manipulate then in instance objects as we wish.

     # File lib/action_view/lookup_context.rb, line 104
104:       def view_paths=(paths)
105:         @view_paths = ActionView::PathSet.new(Array.wrap(paths))
106:       end
with_fallbacks() click to toggle source

Add fallbacks to the view paths. Useful in cases you are rendering a :file.

     # File lib/action_view/lookup_context.rb, line 123
123:       def with_fallbacks
124:         added_resolvers = 0
125:         self.class.fallbacks.each do |resolver|
126:           next if view_paths.include?(resolver)
127:           view_paths.push(resolver)
128:           added_resolvers += 1
129:         end
130:         yield
131:       ensure
132:         added_resolvers.times { view_paths.pop }
133:       end

Protected Instance Methods

detail_args_for(options) click to toggle source

Compute details hash and key according to user options (e.g. passed from #).

     # File lib/action_view/lookup_context.rb, line 144
144:       def detail_args_for(options)
145:         return @details, details_key if options.empty? # most common path.
146:         user_details = @details.merge(options)
147:         [user_details, DetailsKey.get(user_details)]
148:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.