Toggles the visibility of the DOM elements with the given ids. Example:
# Show a few people # Generates: ["person_14", "person_12", "person_23"].each(Element.toggle); page.toggle 'person_14', 'person_12', 'person_23' # Hides the elements page.toggle 'person_14', 'person_12', 'person_23' # Shows the previously hidden elements
Source Code
# File action_view/helpers/prototype_helper.rb, line 822 def toggle(*ids) loop_on_multiple_args 'Element.toggle', ids end
<code/>and<pre/>for code samples.