Module: ActionView::ViewPaths

Extended by:
ActiveSupport::Concern
Included in:
AbstractController::Rendering
Defined in:
actionview/lib/action_view/view_paths.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Methods included from ActiveSupport::Concern

append_features, class_methods, extended, included, prepend_features, prepended

Instance Method Details

#_prefixesObject

The prefixes used in render “foo” shortcuts.



81
82
83
# File 'actionview/lib/action_view/view_paths.rb', line 81

def _prefixes # :nodoc:
  self.class._prefixes
end

#append_view_path(path) ⇒ Object

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)



103
104
105
# File 'actionview/lib/action_view/view_paths.rb', line 103

def append_view_path(path)
  lookup_context.append_view_paths(self.class._build_view_paths(path))
end

#details_for_lookupObject



93
94
95
# File 'actionview/lib/action_view/view_paths.rb', line 93

def details_for_lookup
  {}
end

#lookup_contextObject

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.



88
89
90
91
# File 'actionview/lib/action_view/view_paths.rb', line 88

def lookup_context
  @_lookup_context ||=
    ActionView::LookupContext.new(self.class._view_paths, details_for_lookup, _prefixes)
end

#prepend_view_path(path) ⇒ Object

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)



113
114
115
# File 'actionview/lib/action_view/view_paths.rb', line 113

def prepend_view_path(path)
  lookup_context.prepend_view_paths(self.class._build_view_paths(path))
end