Link to static content using static_path rahter than static_url#448
Open
haakonst wants to merge 1 commit intosmpallen99:masterfrom
Open
Link to static content using static_path rahter than static_url#448haakonst wants to merge 1 commit intosmpallen99:masterfrom
haakonst wants to merge 1 commit intosmpallen99:masterfrom
Conversation
Otherwise links to static resources in ExAdmin will not work in applications that only responds to requests for subdomains of the domain name and not the main (second-level) domain itself, for example as described here: https://blog.gazler.com/blog/2015/07/18/subdomains-with-phoenix/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.eexandadmin_lte2.html.eexby 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_urlis used rather thanstatic_path? This PR suggests switching to usingstatic_pathwhich would be really helpful for applications using subdomains in this way.