Flowdock
method

append_view_path

Importance_2
Ruby on Rails latest stable (v6.1.7.7) - 1 note - Class: ActionController::Base

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here.

These similar methods exist in v6.1.7.7:

append_view_path(path) public

Adds a view_path to the end 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.append_view_path("views/default")
  ArticleController.append_view_path(["views/default", "views/custom"])
Show source
Register or log in to add new notes.
June 26, 2008
8 thanks

Handy for adding theme support

I’m using this to add basic theme support to my app:

append_view_path(File.join(RAILS_ROOT, "app/themes/#{@current_theme}"))
append_view_path(File.join(RAILS_ROOT, 'app/themes/_base'))

Common templates go in app/themes/_base and then you can override these with specific theme versions in each theme directory.