aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGaurish Sharma <contact@gaurishsharma.com>2012-04-25 01:14:57 +0530
committerGaurish Sharma <contact@gaurishsharma.com>2012-04-25 01:14:57 +0530
commit9dbd511172170f60b96012b7b87044638c3962b8 (patch)
treed422cc13b91b517a23e3c596f3f7cb84039712a0
parentf45f1bacb03421094ef3cca9cd541cc41798586c (diff)
downloadrails-9dbd511172170f60b96012b7b87044638c3962b8.tar.gz
rails-9dbd511172170f60b96012b7b87044638c3962b8.tar.bz2
rails-9dbd511172170f60b96012b7b87044638c3962b8.zip
Added warning that require_tree includes files in unspecified order. So, that people may know the order of their scripts might be the reason that their scripts work in just fine in development but not in production.
-rw-r--r--railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt9
1 files changed, 7 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt
index f33a7f4ac2..040fe55220 100644
--- a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt
+++ b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt
@@ -2,10 +2,10 @@
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
-// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
-// the compiled file.
+// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
@@ -14,4 +14,9 @@
//= require <%= options[:javascript] %>
//= require <%= options[:javascript] %>_ujs
<% end -%>
+//
+// require_tree includes all JavaScript/Coffee files present in asset path using an unspecified order.
+// this may cause some scripts to break.
+// To ensure some particular file ends up above some other in the final concatenated file, application.js
+// Simply, require that prerequisite file first in the manifest.
//= require_tree .