--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Replaces the &quot;outer HTML&quot; (i.e., the entire element, not just its contents) of the DOM element with the given <tt>id</tt>.
- !ruby/struct:SM::Flow::P 
  body: "<tt>options_for_render</tt> may be either a string of HTML to insert, or a hash of options to be passed to ActionView::Base#render. For example:"
- !ruby/struct:SM::Flow::VERB 
  body: "  # Replace the DOM element having ID 'person-45' with the\n  # 'person' partial for the appropriate object.\n  page.replace 'person-45', :partial =&gt; 'person', :object =&gt; @person\n"
- !ruby/struct:SM::Flow::P 
  body: This allows the same partial that is used for the <tt>insert_html</tt> to be also used for the input to <tt>replace</tt> without resorting to the use of wrapper elements.
- !ruby/struct:SM::Flow::P 
  body: "Examples:"
- !ruby/struct:SM::Flow::VERB 
  body: "  &lt;div id=&quot;people&quot;&gt;\n    &lt;%= render :partial =&gt; 'person', :collection =&gt; @people %&gt;\n  &lt;/div&gt;\n\n  # Insert a new person\n  #\n  # Generates: new Insertion.Bottom({object: &quot;Matz&quot;, partial: &quot;person&quot;}, &quot;&quot;);\n  page.insert_html :bottom, :partial =&gt; 'person', :object =&gt; @person\n\n  # Replace an existing person\n\n  # Generates: Element.replace(&quot;person_45&quot;, &quot;-- Contents of partial --&quot;);\n  page.replace 'person_45', :partial =&gt; 'person', :object =&gt; @person\n"
full_name: ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods#replace
is_singleton: false
name: replace
params: (id, *options_for_render)
visibility: public
