method
append_view_path
v2.3.8 -
Show latest stable
-
1 note -
Class: ActionController::Base
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3 (0)
- 2.1.0 (0)
- 2.2.1 (0)
- 2.3.8 (0)
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
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"])
Register or
log in
to add new notes.
subblue -
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.