Skip to content

Instantly share code, notes, and snippets.

@bvandgrift
Created November 30, 2010 16:20
Show Gist options
  • Save bvandgrift/721910 to your computer and use it in GitHub Desktop.
Save bvandgrift/721910 to your computer and use it in GitHub Desktop.
prepending and appending to the view search paths in rails3
# 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