Skip to content

Instantly share code, notes, and snippets.

@cloudbring
Created May 6, 2011 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloudbring/958485 to your computer and use it in GitHub Desktop.
Save cloudbring/958485 to your computer and use it in GitHub Desktop.
Uninitialized constant Error
# views/layouts/application.html.haml
# Rails Error: uninitialized constant ActionView::CompiledTemplates::DOMAIN_CONFIG
%p
Request Domain
= request.domain.inspect
DOMAIN_CONFIG:
= DOMAIN_CONFIG.to_yaml
# Multiple Domain Name Setup
#
# Map Various domain names: [deezteez.tld, anticlothes.tld] in
# config/domains.yml to theme which
require 'yaml'
raw_config = File.read(RAILS_ROOT + "/config/domains.yml")
DOMAINS_CONFIG = YAML.load(raw_config)[RAILS_ENV]
# config/domains.yml
production:
domains:
-
:name: foo.com
:template: foo
-
:name: bar.com
:template: bar
development: &non_production_settings
domains:
-
:name: foo.dev
:template: foo
-
:name: bar.dev
:template: bar
test:
<<: *non_production_settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment