Module: ActionView::ViewPaths::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#_prefixesObject

:nodoc:



15
16
17
18
19
20
21
# File 'lib/action_view/view_paths.rb', line 15

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

    local_prefixes + superclass._prefixes
  end
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)



64
65
66
# File 'lib/action_view/view_paths.rb', line 64

def append_view_path(path)
  self._view_paths = view_paths + Array(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)



74
75
76
# File 'lib/action_view/view_paths.rb', line 74

def prepend_view_path(path)
  self._view_paths = ActionView::PathSet.new(Array(path) + view_paths)
end

#view_pathsObject

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



79
80
81
# File 'lib/action_view/view_paths.rb', line 79

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.



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

def view_paths=(paths)
  self._view_paths = ActionView::PathSet.new(Array(paths))
end