Created
August 29, 2008 03:04
-
-
Save quirkey/7891 to your computer and use it in GitHub Desktop.
This file contains 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
module ActionMailer | |
class Base | |
class_inheritable_accessor :view_paths | |
def self.prepend_view_path(path) | |
view_paths.unshift(*path) | |
ActionView::TemplateFinder.process_view_paths(path) | |
end | |
def self.append_view_path(path) | |
view_paths.push(*path) | |
ActionView::TemplateFinder.process_view_paths(path) | |
end | |
private | |
def self.view_paths | |
@@view_paths ||= [template_root] | |
end | |
def view_paths | |
self.class.view_paths | |
end | |
def initialize_template_class(assigns) | |
ActionView::Base.new(view_paths, assigns, self) | |
end | |
end | |
end |
This file contains 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
ActionMailer::Base.prepend_view_path('/my/other/path/to/search/first/') | |
# or | |
ActionMailer::Base.append_view_path('/my/other/path/to/search/last/') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment