method
append_view_path
rails latest stable - Class:
ActionController::Base
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"])
1Note
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.