imjp
imjp

Reputation: 6695

Rails 3.1: Possible to include jQuery from Google's CDN in application.js?

I wanted to know if it's possible to include an external file in the application.js file so it gets combined with the rest of the .js files in the apps/assets/javascript folder

Is there a way to get the following code work in the application.js file:

//= require 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'    

or something :p

Upvotes: 0

Views: 2111

Answers (1)

Vagmi Mudumbai
Vagmi Mudumbai

Reputation: 613

Why would you want to do that? The whole idea of using a CDN is not to load content from your server but other content server. If you would like it to be compiled, just download it to the app/assets/javascripts directory and require it. It is much cleaner that way.

Upvotes: 5

Related Questions