Link to static content using static_path rahter than static_url #448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm developing an application that responds to requests on multiple host names having several different subdomain names under the same main (second-level) domain (for example
customer-a.example.org
,customer-b.example.org
,customer-c.example.org
). The setup is described in this blog post: https://blog.gazler.com/blog/2015/07/18/subdomains-with-phoenix/. However, the application does not respond to requests on the main (second-level) domain name (in this example:example.org
).Since ExAdmin links to static resources (JavaScript and CSS) used by the templates
active_admin.html.eex
andadmin_lte2.html.eex
by using the functionstatic_url
, these resources fail to load in my application. The generated links don't include the subdomain name, like this:https://example.org/css/admin_lte2-4b903242aada0f319f0e076944273dfc.css?vsn=d
https://example.org/js/jquery.min-cfb4c11ee8b6c29969a2a615604d49f9.js?vsn=d
Is there a reason why
static_url
is used rather thanstatic_path
? This PR suggests switching to usingstatic_path
which would be really helpful for applications using subdomains in this way.