replace_html and behaviour


I want to update a div element selected using its class.
This is the code I tried in the RJS:

page.replace_html'#account div.content').first, :partial =>

and also'#account div.content').first.replace_html :partial =>

Neither work whereas the following do work:'#account div.content').each do |d|
page.replace_html d, :partial => 'boxes/account'

I miss something, can someone explain me?

Wrong copy/paste: the partial called is the same for all... return a collection of object, thus you have to iterate over each element before using page.replace_html

_Aurélien Bottazini_

To be slightly more precise is a magic proxy object. I
went into it in some detail here: