static public Method

Base.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"])

Source Code

# File action_controller/base.rb, line 443
def prepend_view_path(path)
  @view_paths = superclass.view_paths.dup if @view_paths.nil?
  view_paths.unshift(*path)
  ActionView::TemplateFinder.process_view_paths(path)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.