W3cubDocs

/Ruby on Rails 5.1

module ActionView::ViewPaths

Public Instance Methods

append_view_path(path) Show source

Append a path to the list of view paths for the current LookupContext.

Parameters

  • path - If a String is provided, it gets converted into the default view path. You may also provide a custom view path (see ActionView::PathSet for more information)

# File actionview/lib/action_view/view_paths.rb, line 55
def append_view_path(path)
  lookup_context.view_paths.push(*path)
end
details_for_lookup() Show source
# File actionview/lib/action_view/view_paths.rb, line 45
def details_for_lookup
  {}
end
lookup_context() Show source

LookupContext is the object responsible for holding all information required for looking up templates, i.e. view paths and details. Check ActionView::LookupContext for more information.

# File actionview/lib/action_view/view_paths.rb, line 40
def lookup_context
  @_lookup_context ||=
    ActionView::LookupContext.new(self.class._view_paths, details_for_lookup, _prefixes)
end
prepend_view_path(path) Show source

Prepend a path to the list of view paths for the current LookupContext.

Parameters

  • path - If a String is provided, it gets converted into the default view path. You may also provide a custom view path (see ActionView::PathSet for more information)

# File actionview/lib/action_view/view_paths.rb, line 65
def prepend_view_path(path)
  lookup_context.view_paths.unshift(*path)
end

© 2004–2017 David Heinemeier Hansson
Licensed under the MIT License.