Skip to content

Instantly share code, notes, and snippets.

@r38y
Last active August 29, 2015 13:57
Show Gist options
  • Save r38y/9421780 to your computer and use it in GitHub Desktop.
Save r38y/9421780 to your computer and use it in GitHub Desktop.
Initializes a registry of view paths for the various themes in our apps.
# this is an initializer and used to set up various themes
# so we can use the same instances on each request
# I'm wondering if $path_set_registry should be a
# constant instead of a global variable
$path_set_registry = {}
Dir.entries('app/views/site_overrides').reject{|e| e.in?(['.', '..'])}.each do|domain|
paths = ["app/views/site_overrides/#{domain}"]
$path_set_registry[domain] = ActionView::PathSet.new(paths)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment