I am struggling with an asset pipeline. I download dojo from the Google CDN by putting this in my template:
= javascript_include_tag 'http://ajax.googleapis.com/ajax/libs/dojo/1.6.1/dojo/dojo.xd.js', :'data-dojo-config' => %Q(dojoBlankHtmlUrl:'/blank.html', baseUrl: 'assets/', modulePaths: {custom: 'javascripts/modules'})
I just want the local version to be backed up locally, or if the CDN is down. I thought about it:
script typeof(dojo) === "undefined" && document.write(unescape('%3Cscript src="js/libs/dojo-1.6.1.min.js"%3E%3C/script%3E'));
But I don’t like it, because it works from the asset pipeline. I want to keep dojo in vendors/assets/javascripts/dojo. How can I get a backup for asset pipeline maintenance.
Is there a way to declare a conditional requirement in an asset pipeline. I want to run some javascript tests and depending on the result serve as a file.
thank
source
share