aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-12-20 23:25:05 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-12-20 23:25:05 +0000
commit71dcc6982e7dcf29675cd3871523e6bdb9cd05a3 (patch)
tree7ee6f11d5b1618425e0786e28540ded918f5ead2 /actionpack
parentb05f0c8e491eaace3460cb058fbfce741e5f16a0 (diff)
downloadrails-71dcc6982e7dcf29675cd3871523e6bdb9cd05a3.tar.gz
rails-71dcc6982e7dcf29675cd3871523e6bdb9cd05a3.tar.bz2
rails-71dcc6982e7dcf29675cd3871523e6bdb9cd05a3.zip
Added toggle to compliment show and hide for RJS
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3329 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index 89d9ea7f2d..f1e67f05f4 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -454,6 +454,11 @@ module ActionView
call 'Element.hide', *ids
end
+ # Toggles the visibility of the DOM elements with the given +ids+.
+ def toggle(*ids)
+ call 'Element.toggle', *ids
+ end
+
# Displays an alert dialog with the given +message+.
def alert(message)
call 'alert', message