Skip to content

Instantly share code, notes, and snippets.

@jou
Created May 30, 2012 09:20
Show Gist options
  • Save jou/2834968 to your computer and use it in GitHub Desktop.
Save jou/2834968 to your computer and use it in GitHub Desktop.
diff --git a/app/helpers/requirejs_helper.rb b/app/helpers/requirejs_helper.rb
index 8de6197..46822c7 100644
--- a/app/helpers/requirejs_helper.rb
+++ b/app/helpers/requirejs_helper.rb
@@ -52,7 +52,11 @@ module RequirejsHelper
# Generate digestified paths from the modules spec
paths = {}
- modules.each { |m| paths[m] = _javascript_path(m).sub /\.js$/,'' }
+ modules.each do |m|
+ module_file = m
+ module_file += ".js" unless module_file =~ /\.js$/
+ paths[m] = _javascript_path(module_file).sub /\.js$/,''
+ end
if run_config.has_key? 'paths'
# Add paths for assets specified by full URL (on a CDN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment