public Method

GeneratorMethods.replace_html(id, *options_for_render)

Replaces the inner HTML of the DOM element with the given id.

options_for_render may be either a string of HTML to insert, or a hash of options to be passed to ActionView::Base#render. For example:

# Replace the HTML of the DOM element having ID 'person-45' with the
# 'person' partial for the appropriate object.
# Generates:  Element.update("person-45", "-- Contents of 'person' partial --");
replace_html 'person-45', :partial => 'person', :object => @person

Source Code

# File action_view/helpers/prototype_helper.rb, line 740
def replace_html(id, *options_for_render)
  call 'Element.update', id, render(*options_for_render)
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.