Module: AbstractController::ViewPaths::ClassMethods

Defined in:
actionpack/lib/abstract_controller/view_paths.rb,
actionpack/lib/abstract_controller/view_paths.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) append_view_path(path)

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)



65
66
67
# File 'actionpack/lib/abstract_controller/view_paths.rb', line 65

def append_view_path(path)
  self.view_paths = view_paths.dup + Array(path)
end

- (Object) parent_prefixes



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'actionpack/lib/abstract_controller/view_paths.rb', line 15

def parent_prefixes
  @parent_prefixes ||= begin
    parent_controller = superclass
    prefixes = []

    until parent_controller.abstract?
      prefixes << parent_controller.controller_path
      parent_controller = parent_controller.superclass
    end

    prefixes
  end
end

- (Object) prepend_view_path(path)

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)



75
76
77
# File 'actionpack/lib/abstract_controller/view_paths.rb', line 75

def prepend_view_path(path)
  self.view_paths = Array(path) + view_paths.dup
end

- (Object) view_paths

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



80
81
82
# File 'actionpack/lib/abstract_controller/view_paths.rb', line 80

def view_paths
  _view_paths
end

- (Object) view_paths=(paths)

Set the view paths.

Parameters

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



89
90
91
92
# File 'actionpack/lib/abstract_controller/view_paths.rb', line 89

def view_paths=(paths)
  self._view_paths = ActionView::Base.process_view_paths(paths)
  self._view_paths.freeze
end