Move the scripts helper into a better place.

This commit is contained in:
M Smart 2014-07-22 20:14:57 -04:00
parent ec280913b2
commit 0d9e2b5df5
2 changed files with 3 additions and 7 deletions

View File

@ -1,7 +1,7 @@
module DeferredJavascriptsHelper
module DeferredScriptsHelper
# Provides a javascript map of the files in the 'defer' directory
def deferred_javascripts
def deferred_scripts
files = {}
Dir.glob("#{Rails.root}/app/assets/javascripts/defer/*.js").each do |file|
@ -14,7 +14,3 @@ module DeferredJavascriptsHelper
end
end
module Sprockets::Rails::Helper
include DeferredJavascriptsHelper
end

View File

@ -1,7 +1,7 @@
<script>
window.assetPath = (function(){
var map = <%= deferred_javascripts %>;
var map = <%= deferred_scripts %>;
return function(asset){ return map[asset]; };
})();