Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Require directive - file url

In Rails 3 (Sprocket), is there a way to load a javascript file using a url to a remote site? For example, I want something similar to this in your .js file using the require directive,

//= require http://example.com/remote_file.js
like image 279
RubyFanatic Avatar asked Feb 18 '23 17:02

RubyFanatic


1 Answers

No.

You can only require files that are inside your application or in gems that your application depend on. See http://guides.rubyonrails.org/asset_pipeline.html#asset-organization and http://guides.rubyonrails.org/asset_pipeline.html#adding-assets-to-your-gems.

like image 185
Lucas Avatar answered Feb 20 '23 09:02

Lucas