mercredi 23 septembre 2015

rails assets in CDN

I am going to move my assets from rails to amazon cloudfront cdn. I have moved images and give path from /assets/images to http://ift.tt/1Mpykw1.

Now I would like to move my stylesheets and JS files, but in rails all stylesheets and JS files are included in application.css and applications.js and served with the asset pipeline. and it's enough

<%= stylesheet_link_tag    "application" %>
<%= javascript_include_tag "application" %>

to include above lines in application.html.erb. If I move all my JS files to CDN means how to call them in application.html.erb file? Whether I have to include all the js files (they are at-least 20-25 ) using javascript_include_tag or any other way to call them in assets pipeline itself from CDN.

Aucun commentaire:

Enregistrer un commentaire