Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Rails asset pipeline or a CDN #52

Closed
amalagaura opened this issue Jan 12, 2013 · 2 comments
Closed

Compatibility with Rails asset pipeline or a CDN #52

amalagaura opened this issue Jan 12, 2013 · 2 comments

Comments

@amalagaura
Copy link

Right now I am only able to load javascripts from /public. I am unable to load from vendor/assets or from the CDN at : http://cdn.sencha.io/ext-4.1.0-gpl/

I used an initializer as follows:

Netzke::Core.setup do |config|
  config.ext_uri = 'assets'
end
Netzke::Core.setup do |config|
  config.ext_uri = 'http://cdn.sencha.io/ext-4.1.0-gpl'
end

using 'assets' as a prefix causes a linktag of:
http://localhost:3000/assets/assets/ext-all-debug.js

expecting it to be:
http://localhost:3000/assets/ext-all-debug.js

Using the CDN gives the following, no .js because it does not find the JS file:
http://cdn.sencha.io/ext-4.1.0-gpl/ext-all-debug

(should be http://cdn.sencha.io/ext-4.1.0-gpl/ext-all-debug.js)

I think the best way is to support
config.action_controller.asset_host

_uri if present would override using the asset_host based link tags.

Otherwise we should specify a prefix (with a default of 'assets') so that files can be put in /vendor/assets as Rails guides recommends. Using public is deprecated with the Rails asset pipeline.

@mxgrn
Copy link

mxgrn commented Jan 12, 2013

Thanks for pointing it out. This aspect of Netzke certainly needs a rework.

Btw, this:

Netzke::Core.setup do |config|
config.ext_uri = 'http://cdn.sencha.io/ext-4.1.0-gpl'
end

will work properly in Core 0.8.2 (edge). But unfortunately Basepack still relies on Ext JS files being located in public.

@mxgrn
Copy link

mxgrn commented Dec 27, 2015

This is working in the later versions. Closing.

@mxgrn mxgrn closed this as completed Dec 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants