Created
November 30, 2010 16:20
-
-
Save bvandgrift/721910 to your computer and use it in GitHub Desktop.
prepending and appending to the view search paths in rails3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# throw something like this in an initializer | |
ActionController::Base.class_eval do | |
self.prepend_view_path "first/search/here" | |
# then the defaults (app/views/*) | |
self.append_view_path "then/search/here" | |
end | |
# an example, say you want a theme, and the name is stored in App.theme_name? | |
ActionController::Base.class_eval do | |
self.prepend_view_path "themes/#{App.theme_name}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment