Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 8b99df826c3b6cf56a1caaae5f931d50 > files > 849

ruby-actionpack-2.3.4-1mdv2010.0.noarch.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../../../files/lib/action_view/helpers/prototype_helper_rb.html">
                lib/action_view/helpers/prototype_helper.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
JavaScriptGenerator generates blocks of JavaScript code that allow you to
change the content and presentation of multiple DOM elements. Use this in
your Ajax response bodies, either in a &lt;script&gt; tag or as plain
JavaScript sent with a Content-type of &quot;text/javascript&quot;.
</p>
<p>
Create new instances with <a
href="../../PrototypeHelper.html#M000466">PrototypeHelper#update_page</a>
or with ActionController::Base#render, then <a
href="GeneratorMethods.html#M000485">call</a> <tt><a
href="GeneratorMethods.html#M000475">insert_html</a></tt>, <tt><a
href="GeneratorMethods.html#M000476">replace_html</a></tt>, <tt><a
href="GeneratorMethods.html#M000478">remove</a></tt>, <tt><a
href="GeneratorMethods.html#M000479">show</a></tt>, <tt><a
href="GeneratorMethods.html#M000480">hide</a></tt>, <tt><a
href="GeneratorMethods.html#M000489">visual_effect</a></tt>, or any other
of the built-in methods on the yielded generator in any order you like to
modify the content and appearance of the current page.
</p>
<p>
Example:
</p>
<pre>
  # Generates:
  #     new Element.insert(&quot;list&quot;, { bottom: &quot;&lt;li&gt;Some item&lt;/li&gt;&quot; });
  #     new Effect.Highlight(&quot;list&quot;);
  #     [&quot;status-indicator&quot;, &quot;cancel-link&quot;].each(Element.hide);
  update_page do |page|
    page.insert_html :bottom, 'list', &quot;&lt;li&gt;#{@item.name}&lt;/li&gt;&quot;
    page.visual_effect :highlight, 'list'
    page.hide 'status-indicator', 'cancel-link'
  end
</pre>
<p>
Helper methods can be used in conjunction with JavaScriptGenerator. When a
helper method is called inside an update block on the <tt>page</tt> object,
that method will also have access to a <tt>page</tt> object.
</p>
<p>
Example:
</p>
<pre>
  module ApplicationHelper
    def update_time
      page.replace_html 'time', Time.now.to_s(:db)
      page.visual_effect :highlight, 'time'
    end
  end

  # Controller action
  def poll
    render(:update) { |page| page.update_time }
  end
</pre>
<p>
Calls to JavaScriptGenerator not matching a helper method below generate a
proxy to the JavaScript Class named by the method called.
</p>
<p>
Examples:
</p>
<pre>
  # Generates:
  #     Foo.init();
  update_page do |page|
    page.foo.init
  end

  # Generates:
  #     Event.observe('one', 'click', function () {
  #       $('two').show();
  #     });
  update_page do |page|
    page.event.observe('one', 'click') do |p|
     p[:two].show
    end
  end
</pre>
<p>
You can also use <a
href="../../PrototypeHelper.html#M000467">PrototypeHelper#update_page_tag</a>
instead of <a
href="../../PrototypeHelper.html#M000466">PrototypeHelper#update_page</a>
to wrap the generated JavaScript in a &lt;script&gt; tag.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000487">&lt;&lt;</a>&nbsp;&nbsp;
      <a href="#M000472">[]</a>&nbsp;&nbsp;
      <a href="#M000482">alert</a>&nbsp;&nbsp;
      <a href="#M000486">assign</a>&nbsp;&nbsp;
      <a href="#M000485">call</a>&nbsp;&nbsp;
      <a href="#M000488">delay</a>&nbsp;&nbsp;
      <a href="#M000491">draggable</a>&nbsp;&nbsp;
      <a href="#M000492">drop_receiving</a>&nbsp;&nbsp;
      <a href="#M000480">hide</a>&nbsp;&nbsp;
      <a href="#M000475">insert_html</a>&nbsp;&nbsp;
      <a href="#M000473">literal</a>&nbsp;&nbsp;
      <a href="#M000483">redirect_to</a>&nbsp;&nbsp;
      <a href="#M000484">reload</a>&nbsp;&nbsp;
      <a href="#M000478">remove</a>&nbsp;&nbsp;
      <a href="#M000477">replace</a>&nbsp;&nbsp;
      <a href="#M000476">replace_html</a>&nbsp;&nbsp;
      <a href="#M000474">select</a>&nbsp;&nbsp;
      <a href="#M000479">show</a>&nbsp;&nbsp;
      <a href="#M000490">sortable</a>&nbsp;&nbsp;
      <a href="#M000481">toggle</a>&nbsp;&nbsp;
      <a href="#M000489">visual_effect</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000487" class="method-detail">
        <a name="M000487"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000487.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000487.html');return false;">
          <span class="method-name">&lt;&lt;</span><span class="method-args">(javascript)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Writes raw JavaScript to the page.
</p>
<p>
Example:
</p>
<pre>
 page &lt;&lt; &quot;alert('JavaScript with Prototype.');&quot;
</pre>
        </div>
      </div>

      <div id="method-M000472" class="method-detail">
        <a name="M000472"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000472.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000472.html');return false;">
          <span class="method-name">[]</span><span class="method-args">(id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a element reference by finding it through <tt>id</tt> in the DOM.
This element can then be used for further method calls. Examples:
</p>
<pre>
  page['blank_slate']                  # =&gt; $('blank_slate');
  page['blank_slate'].show             # =&gt; $('blank_slate').show();
  page['blank_slate'].show('first').up # =&gt; $('blank_slate').show('first').up();
</pre>
<p>
You can also pass in a record, which will use
ActionController::RecordIdentifier.dom_id to lookup the correct id:
</p>
<pre>
  page[@post]     # =&gt; $('post_45')
  page[Post.new]  # =&gt; $('new_post')
</pre>
        </div>
      </div>

      <div id="method-M000482" class="method-detail">
        <a name="M000482"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000482.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000482.html');return false;">
          <span class="method-name">alert</span><span class="method-args">(message)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Displays an <a href="GeneratorMethods.html#M000482">alert</a> dialog with
the given <tt>message</tt>.
</p>
<p>
Example:
</p>
<pre>
  # Generates: alert('This message is from Rails!')
  page.alert('This message is from Rails!')
</pre>
        </div>
      </div>

      <div id="method-M000486" class="method-detail">
        <a name="M000486"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000486.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000486.html');return false;">
          <span class="method-name">assign</span><span class="method-args">(variable, value)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Assigns the JavaScript <tt>variable</tt> the given <tt>value</tt>.
</p>
<p>
Examples:
</p>
<pre>
 # Generates: my_string = &quot;This is mine!&quot;;
 page.assign 'my_string', 'This is mine!'

 # Generates: record_count = 33;
 page.assign 'record_count', 33

 # Generates: tabulated_total = 47
 page.assign 'tabulated_total', @total_from_cart
</pre>
        </div>
      </div>

      <div id="method-M000485" class="method-detail">
        <a name="M000485"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000485.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000485.html');return false;">
          <span class="method-name">call</span><span class="method-args">(function, *arguments, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Calls the JavaScript <tt>function</tt>, optionally with the given
<tt>arguments</tt>.
</p>
<p>
If a block is given, the block will be passed to a new JavaScriptGenerator;
the resulting JavaScript code will then be wrapped inside <tt>function() {
&#8230; }</tt> and passed as the called function&#8216;s final argument.
</p>
<p>
Examples:
</p>
<pre>
  # Generates: Element.replace(my_element, &quot;My content to replace with.&quot;)
  page.call 'Element.replace', 'my_element', &quot;My content to replace with.&quot;

  # Generates: alert('My message!')
  page.call 'alert', 'My message!'

  # Generates:
  #     my_method(function() {
  #       $(&quot;one&quot;).show();
  #       $(&quot;two&quot;).hide();
  #    });
  page.call(:my_method) do |p|
     p[:one].show
     p[:two].hide
  end
</pre>
        </div>
      </div>

      <div id="method-M000488" class="method-detail">
        <a name="M000488"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000488.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000488.html');return false;">
          <span class="method-name">delay</span><span class="method-args">(seconds = 1) {|| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Executes the content of the block after a <a
href="GeneratorMethods.html#M000488">delay</a> of <tt>seconds</tt>.
Example:
</p>
<pre>
  # Generates:
  #     setTimeout(function() {
  #     ;
  #     new Effect.Fade(&quot;notice&quot;,{});
  #     }, 20000);
  page.delay(20) do
    page.visual_effect :fade, 'notice'
  end
</pre>
        </div>
      </div>

      <div id="method-M000491" class="method-detail">
        <a name="M000491"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000491.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000491.html');return false;">
          <span class="method-name">draggable</span><span class="method-args">(id, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a script.aculo.us <a
href="GeneratorMethods.html#M000491">draggable</a> element. See <a
href="../../ScriptaculousHelper.html">ActionView::Helpers::ScriptaculousHelper</a>
for more information.
</p>
        </div>
      </div>

      <div id="method-M000492" class="method-detail">
        <a name="M000492"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000492.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000492.html');return false;">
          <span class="method-name">drop_receiving</span><span class="method-args">(id, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a script.aculo.us drop receiving element. See <a
href="../../ScriptaculousHelper.html">ActionView::Helpers::ScriptaculousHelper</a>
for more information.
</p>
        </div>
      </div>

      <div id="method-M000480" class="method-detail">
        <a name="M000480"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000480.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000480.html');return false;">
          <span class="method-name">hide</span><span class="method-args">(*ids)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Hides the visible DOM elements with the given <tt>ids</tt>.
</p>
<p>
Example:
</p>
<pre>
 # Hide a few people
 # Generates: [&quot;person_29&quot;, &quot;person_9&quot;, &quot;person_0&quot;].each(Element.hide);
 page.hide 'person_29', 'person_9', 'person_0'
</pre>
        </div>
      </div>

      <div id="method-M000475" class="method-detail">
        <a name="M000475"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000475.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000475.html');return false;">
          <span class="method-name">insert_html</span><span class="method-args">(position, id, *options_for_render)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Inserts HTML at the specified <tt>position</tt> relative to the DOM element
identified by the given <tt>id</tt>.
</p>
<p>
<tt>position</tt> may be one of:
</p>
<table>
<tr><td valign="top"><tt>:top</tt>:</td><td>HTML is inserted inside the element, before the element&#8216;s existing
content.

</td></tr>
<tr><td valign="top"><tt>:bottom</tt>:</td><td>HTML is inserted inside the element, after the element&#8216;s existing
content.

</td></tr>
<tr><td valign="top"><tt>:before</tt>:</td><td>HTML is inserted immediately preceding the element.

</td></tr>
<tr><td valign="top"><tt>:after</tt>:</td><td>HTML is inserted immediately following the element.

</td></tr>
</table>
<p>
<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:
</p>
<pre>
  # Insert the rendered 'navigation' partial just before the DOM
  # element with ID 'content'.
  # Generates: Element.insert(&quot;content&quot;, { before: &quot;-- Contents of 'navigation' partial --&quot; });
  page.insert_html :before, 'content', :partial =&gt; 'navigation'

  # Add a list item to the bottom of the &lt;ul&gt; with ID 'list'.
  # Generates: Element.insert(&quot;list&quot;, { bottom: &quot;&lt;li&gt;Last item&lt;/li&gt;&quot; });
  page.insert_html :bottom, 'list', '&lt;li&gt;Last item&lt;/li&gt;'
</pre>
        </div>
      </div>

      <div id="method-M000473" class="method-detail">
        <a name="M000473"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000473.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000473.html');return false;">
          <span class="method-name">literal</span><span class="method-args">(code)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns an object whose <tt>to_json</tt> evaluates to <tt>code</tt>. Use
this to pass a <a href="GeneratorMethods.html#M000473">literal</a>
JavaScript expression as an argument to another JavaScriptGenerator method.
</p>
        </div>
      </div>

      <div id="method-M000483" class="method-detail">
        <a name="M000483"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000483.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000483.html');return false;">
          <span class="method-name">redirect_to</span><span class="method-args">(location)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Redirects the browser to the given <tt>location</tt> using JavaScript, in
the same form as <tt>url_for</tt>.
</p>
<p>
Examples:
</p>
<pre>
 # Generates: window.location.href = &quot;/mycontroller&quot;;
 page.redirect_to(:action =&gt; 'index')

 # Generates: window.location.href = &quot;/account/signup&quot;;
 page.redirect_to(:controller =&gt; 'account', :action =&gt; 'signup')
</pre>
        </div>
      </div>

      <div id="method-M000484" class="method-detail">
        <a name="M000484"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000484.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000484.html');return false;">
          <span class="method-name">reload</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Reloads the browser&#8216;s current <tt>location</tt> using JavaScript
</p>
<p>
Examples:
</p>
<pre>
 # Generates: window.location.reload();
 page.reload
</pre>
        </div>
      </div>

      <div id="method-M000478" class="method-detail">
        <a name="M000478"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000478.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000478.html');return false;">
          <span class="method-name">remove</span><span class="method-args">(*ids)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Removes the DOM elements with the given <tt>ids</tt> from the page.
</p>
<p>
Example:
</p>
<pre>
 # Remove a few people
 # Generates: [&quot;person_23&quot;, &quot;person_9&quot;, &quot;person_2&quot;].each(Element.remove);
 page.remove 'person_23', 'person_9', 'person_2'
</pre>
        </div>
      </div>

      <div id="method-M000477" class="method-detail">
        <a name="M000477"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000477.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000477.html');return false;">
          <span class="method-name">replace</span><span class="method-args">(id, *options_for_render)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
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>.
</p>
<p>
<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:
</p>
<pre>
  # Replace the DOM element having ID 'person-45' with the
  # 'person' partial for the appropriate object.
  page.replace 'person-45', :partial =&gt; 'person', :object =&gt; @person
</pre>
<p>
This allows the same partial that is used for the <tt><a
href="GeneratorMethods.html#M000475">insert_html</a></tt> to be also used
for the input to <tt><a
href="GeneratorMethods.html#M000477">replace</a></tt> without resorting to
the use of wrapper elements.
</p>
<p>
Examples:
</p>
<pre>
  &lt;div id=&quot;people&quot;&gt;
    &lt;%= render :partial =&gt; 'person', :collection =&gt; @people %&gt;
  &lt;/div&gt;

  # Insert a new person
  #
  # Generates: new Insertion.Bottom({object: &quot;Matz&quot;, partial: &quot;person&quot;}, &quot;&quot;);
  page.insert_html :bottom, :partial =&gt; 'person', :object =&gt; @person

  # Replace an existing person

  # Generates: Element.replace(&quot;person_45&quot;, &quot;-- Contents of partial --&quot;);
  page.replace 'person_45', :partial =&gt; 'person', :object =&gt; @person
</pre>
        </div>
      </div>

      <div id="method-M000476" class="method-detail">
        <a name="M000476"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000476.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000476.html');return false;">
          <span class="method-name">replace_html</span><span class="method-args">(id, *options_for_render)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Replaces the inner HTML of the DOM element with the given <tt>id</tt>.
</p>
<p>
<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:
</p>
<pre>
  # Replace the HTML of the DOM element having ID 'person-45' with the
  # 'person' partial for the appropriate object.
  # Generates:  Element.update(&quot;person-45&quot;, &quot;-- Contents of 'person' partial --&quot;);
  page.replace_html 'person-45', :partial =&gt; 'person', :object =&gt; @person
</pre>
        </div>
      </div>

      <div id="method-M000474" class="method-detail">
        <a name="M000474"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000474.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000474.html');return false;">
          <span class="method-name">select</span><span class="method-args">(pattern)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a collection reference by finding it through a CSS <tt>pattern</tt>
in the DOM. This collection can then be used for further method calls.
Examples:
</p>
<pre>
  page.select('p')                      # =&gt; $$('p');
  page.select('p.welcome b').first      # =&gt; $$('p.welcome b').first();
  page.select('p.welcome b').first.hide # =&gt; $$('p.welcome b').first().hide();
</pre>
<p>
You can also use prototype enumerations with the collection. Observe:
</p>
<pre>
  # Generates: $$('#items li').each(function(value) { value.hide(); });
  page.select('#items li').each do |value|
    value.hide
  end
</pre>
<p>
Though you can <a href="GeneratorMethods.html#M000485">call</a> the block
param anything you want, they are always rendered in the javascript as
&#8216;value, index.&#8217; Other enumerations, like collect() return the
last statement:
</p>
<pre>
  # Generates: var hidden = $$('#items li').collect(function(value, index) { return value.hide(); });
  page.select('#items li').collect('hidden') do |item|
    item.hide
  end
</pre>
        </div>
      </div>

      <div id="method-M000479" class="method-detail">
        <a name="M000479"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000479.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000479.html');return false;">
          <span class="method-name">show</span><span class="method-args">(*ids)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Shows hidden DOM elements with the given <tt>ids</tt>.
</p>
<p>
Example:
</p>
<pre>
 # Show a few people
 # Generates: [&quot;person_6&quot;, &quot;person_13&quot;, &quot;person_223&quot;].each(Element.show);
 page.show 'person_6', 'person_13', 'person_223'
</pre>
        </div>
      </div>

      <div id="method-M000490" class="method-detail">
        <a name="M000490"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000490.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000490.html');return false;">
          <span class="method-name">sortable</span><span class="method-args">(id, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Creates a script.aculo.us <a
href="GeneratorMethods.html#M000490">sortable</a> element. Useful to
recreate <a href="GeneratorMethods.html#M000490">sortable</a> elements
after items get added or deleted. See <a
href="../../ScriptaculousHelper.html">ActionView::Helpers::ScriptaculousHelper</a>
for more information.
</p>
        </div>
      </div>

      <div id="method-M000481" class="method-detail">
        <a name="M000481"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000481.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000481.html');return false;">
          <span class="method-name">toggle</span><span class="method-args">(*ids)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Toggles the visibility of the DOM elements with the given <tt>ids</tt>.
Example:
</p>
<pre>
 # Show a few people
 # Generates: [&quot;person_14&quot;, &quot;person_12&quot;, &quot;person_23&quot;].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
</pre>
        </div>
      </div>

      <div id="method-M000489" class="method-detail">
        <a name="M000489"></a>

        <div class="method-heading">
          <a href="GeneratorMethods.src/M000489.html" target="Code" class="method-signature"
            onclick="popupCode('GeneratorMethods.src/M000489.html');return false;">
          <span class="method-name">visual_effect</span><span class="method-args">(name, id = nil, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Starts a script.aculo.us visual effect. See <a
href="../../ScriptaculousHelper.html">ActionView::Helpers::ScriptaculousHelper</a>
for more information.
</p>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>