aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-05 10:23:51 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-05 10:23:51 +0000
commit5eee93864339b5055ee72155fd00adee7bbfafcd (patch)
tree17b3c718fef8e17548c3c52635c68b702e3357e7
parente08025db6f3509db2f2f108ab1004c2d972ca623 (diff)
downloadrails-5eee93864339b5055ee72155fd00adee7bbfafcd.tar.gz
rails-5eee93864339b5055ee72155fd00adee7bbfafcd.tar.bz2
rails-5eee93864339b5055ee72155fd00adee7bbfafcd.zip
Added javascript_include_tag :defaults shortcut that'll include all the default javascripts included with Action Pack (prototype, effects, controls, dragdrop)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1707 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_view/helpers/asset_tag_helper.rb7
2 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 6a13be1174..0dd82275f0 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Added javascript_include_tag :defaults shortcut that'll include all the default javascripts included with Action Pack (prototype, effects, controls, dragdrop)
+
* Cache several controller variables that are expensive to calculate #1229 [skaes@web.de]
* The session class backing CGI::Session::ActiveRecordStore may be replaced with any class that duck-types with a subset of Active Record. See docs for details #1238 [skaes@web.de]
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index 9970244fb0..cd56592300 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -43,8 +43,15 @@ module ActionView
# javascript_include_tag "common.javascript", "/elsewhere/cools" # =>
# <script type="text/javascript" src="/javascripts/common.javascript"></script>
# <script type="text/javascript" src="/elsewhere/cools.js"></script>
+ #
+ # javascript_include_tag :defaults # =>
+ # <script type="text/javascript" src="/javascripts/prototype.js"></script>
+ # <script type="text/javascript" src="/javascripts/effects.js"></script>
+ # <script type="text/javascript" src="/javascripts/controls.js"></script>
+ # <script type="text/javascript" src="/javascripts/dragdrop.js"></script>
def javascript_include_tag(*sources)
options = sources.last.is_a?(Hash) ? sources.pop.stringify_keys : { }
+ sources = ['prototype', 'effects', 'controls', 'dragdrop'] if sources.first == :defaults
sources.collect { |source|
source = javascript_path(source)
content_tag("script", "", { "type" => "text/javascript", "src" => source }.merge(options))