Module: ActionView::ViewPaths::ClassMethods

Defined in:
actionview/lib/action_view/view_paths.rb

Instance Method Summary collapse

Instance Method Details

#_build_view_paths(paths) ⇒ Object

:nodoc:



31
32
33
34
35
36
# File 'actionview/lib/action_view/view_paths.rb', line 31

def _build_view_paths(paths) # :nodoc:
  return paths if ActionView::PathSet === paths

  paths = ActionView::PathRegistry.cast_file_system_resolvers(paths)
  ActionView::PathSet.new(paths)
end

#_prefixesObject

:nodoc:



23
24
25
26
27
28
29
# File 'actionview/lib/action_view/view_paths.rb', line 23

def _prefixes # :nodoc:
  @_prefixes ||= begin
    return local_prefixes if superclass.abstract?

    local_prefixes + superclass._prefixes
  end
end

#_view_pathsObject



15
16
17
# File 'actionview/lib/action_view/view_paths.rb', line 15

def _view_paths
  ActionView::PathRegistry.get_view_paths(self)
end

#_view_paths=(paths) ⇒ Object



19
20
21
# File 'actionview/lib/action_view/view_paths.rb', line 19

def _view_paths=(paths)
  ActionView::PathRegistry.set_view_paths(self, paths)
end

#append_view_path(path) ⇒ Object

Append a path to the list of view paths for this controller.

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)



44
45
46
# File 'actionview/lib/action_view/view_paths.rb', line 44

def append_view_path(path)
  self._view_paths = view_paths + _build_view_paths(path)
end

#prepend_view_path(path) ⇒ Object

Prepend a path to the list of view paths for this controller.

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)



54
55
56
# File 'actionview/lib/action_view/view_paths.rb', line 54

def prepend_view_path(path)
  self._view_paths = _build_view_paths(path) + view_paths
end

#view_pathsObject

A list of all of the default view paths for this controller.



59
60
61
# File 'actionview/lib/action_view/view_paths.rb', line 59

def view_paths
  _view_paths
end

#view_paths=(paths) ⇒ Object

Set the view paths.

Parameters

  • paths - If a PathSet is provided, use that; otherwise, process the parameter into a PathSet.



68
69
70
# File 'actionview/lib/action_view/view_paths.rb', line 68

def view_paths=(paths)
  self._view_paths = _build_view_paths(paths)
end