diff options
author | francis <francis> | 2009-08-24 12:39:04 +0000 |
---|---|---|
committer | francis <francis> | 2009-08-24 12:39:04 +0000 |
commit | 02e81b4c04ee686db737f4e91797c776bd2bc1bd (patch) | |
tree | a5da4b70465a8d848f0093c3f3f723d79b371a5e | |
parent | 3dcb939bfb8fec208927a230885acbb13e430d73 (diff) |
Use full URL for javascript so works in admin pages.
-rw-r--r-- | app/views/layouts/admin.rhtml | 5 | ||||
-rw-r--r-- | config/environment.rb | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml index 306af03e7..426a01cf5 100644 --- a/app/views/layouts/admin.rhtml +++ b/app/views/layouts/admin.rhtml @@ -3,10 +3,7 @@ <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" > <title>WhatDoTheyKnow admin<%= @title ? ":" : "" %> <%=@title%></title> - <% - # Have to do explicit tag for stylesheet, to get absolute path on main server - %> - <%= tag("link", { "rel" => "Stylesheet", "type" => "text/css", "media" => "screen", "href" => admin_public_url(stylesheet_path('admin')) }) %> + <%= stylesheet_link_tag 'admin', :title => "Main", :rel => "stylesheet" %> </head> <body> diff --git a/config/environment.rb b/config/environment.rb index 76f459889..85e23e8a4 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -97,6 +97,11 @@ end # Domain for URLs (so can work for scripts, not just web pages) ActionController::UrlWriter.default_url_options[:host] = MySociety::Config.get("DOMAIN", 'localhost:3000') +# So that javascript assets use full URL, so proxied admin URLs read javascript OK +if (MySociety::Config.get("DOMAIN", "") != "") + ActionController::Base.asset_host = MySociety::Config.get("DOMAIN", 'localhost:3000') +end + # Monkeypatch! Method to remove individual error messages from an ActiveRecord. module ActiveRecord class Errors |