From 0d9e2b5df52bd34df26e29565f21654b58bfe78f Mon Sep 17 00:00:00 2001 From: M Smart Date: Tue, 22 Jul 2014 20:14:57 -0400 Subject: [PATCH] Move the scripts helper into a better place. --- .../helpers/deferred_scripts_helper.rb | 8 ++------ app/views/common/_discourse_javascript.html.erb | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) rename config/initializers/deferred_javascripts_helper.rb => app/helpers/deferred_scripts_helper.rb (73%) diff --git a/config/initializers/deferred_javascripts_helper.rb b/app/helpers/deferred_scripts_helper.rb similarity index 73% rename from config/initializers/deferred_javascripts_helper.rb rename to app/helpers/deferred_scripts_helper.rb index ae4f963cecf..66c42fdd105 100644 --- a/config/initializers/deferred_javascripts_helper.rb +++ b/app/helpers/deferred_scripts_helper.rb @@ -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 diff --git a/app/views/common/_discourse_javascript.html.erb b/app/views/common/_discourse_javascript.html.erb index 8b26e916b16..77f0c14c155 100644 --- a/app/views/common/_discourse_javascript.html.erb +++ b/app/views/common/_discourse_javascript.html.erb @@ -1,7 +1,7 @@