[Nitro] [PATCH] update morpher

Alexandre Gravem vikingtux at gmail.com
Wed Sep 13 03:45:42 EDT 2006

it's the first patch i am submitting for the list. i hope it might be useful
for someone :D

the patch adds a new morpher similar to AsyncMorpher, but it updates an
element using Prototype's Ajax.Updater. So if you have some template like

<div id="mydiv">&nbsp;</div>
<a href="/some_action" update="mydiv">Click</a>

the content of the "mydiv" div will be replaced with the compiled template
of some_action. If you use it in a <form/> the elements of the form are
serialized and sent, so you can acess them with request[] inside your
controller like this

Hello <span id="myname">Anonymous</span>
<form action="/say_hello" update="myname">
  <input type="text" name="guest_name"/>

def say_hello
  print request['guest_name']

A. Gravem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20060913/a88364c8/attachment.html 

More information about the Nitro-general mailing list