public Method

GeneratorMethods.toggle(*ids)

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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.