diff options
Diffstat (limited to 'lib/alavetelitheme.rb')
-rw-r--r-- | lib/alavetelitheme.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/alavetelitheme.rb b/lib/alavetelitheme.rb index b4f93a5..d3998b2 100644 --- a/lib/alavetelitheme.rb +++ b/lib/alavetelitheme.rb @@ -1,7 +1,11 @@ class ActionController::Base - before_filter :set_view_paths - - def set_view_paths + # The following prepends the path of the current theme's views to + # the "filter_path" that Rails searches when deciding which + # template to use for a view. It does so by creating a method + # uniquely named for this theme. + path_function_name = "set_view_paths_for_#{THEME_NAME}" + before_filter path_function_name.to_sym + send :define_method, path_function_name do self.prepend_view_path File.join(File.dirname(__FILE__), "views") end end |