class method self.prepend_view_path

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

self.prepend_view_path(path)

Adds a view_path to the front of the view_paths array. If the current class has no view paths, copy them from the superclass. This change will be visible for all future requests.

ArticleController.prepend_view_path("views/default")
ArticleController.prepend_view_path(["views/default", "views/custom"])

Parameters

path req
Source
# File actionpack/lib/action_controller/base.rb, line 443
      def prepend_view_path(path)
        @view_paths = superclass.view_paths.dup if !defined?(@view_paths) || @view_paths.nil?
        @view_paths.unshift(*path)
      end

Defined in actionpack/lib/action_controller/base.rb line 443 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::Base

Type at least 2 characters to search.

↑↓ navigate · open · esc close