RJS template / page.insert_html problem

Hiall,

I have a rjs template which is calling page[:xxx].replace_html … a
couple of times and this works perfectly. However, in the same rjs
file I have two calls to page.insert_html, which do not work. No error
in development.log, nor error message in browser, the new content for
the div simply isn’t changed at all.

This is my code:


action = “save_” + controller.action_name
page.insert_html :before, “block_2”, form_remote_tag( :url => {
:action => action }, :html => { :id => “input_form” })
page.insert_html :after, “block_3”, end_form_tag

which doesn’t change the generated AT ALL, my form tag never gets
written :frowning:

What is it that I’m doing wrong??
Any help very much appreciated!!

On a sidenote:
I read about this before on this list, so I state it again. page[:xxx]
construct isn’t working uniformly for me.
While
page[:xxx].replace_html,
works fine

page[:xxx].insert_html :before “blabla”
pops up a javascript error message saying that $(“xxx”).insertHtml is
not a valid function

I think handling of [] operator should be uniform over all those methods

cheers
Martin

Are you using FireBug? It will show you what’s getting generated.
That should lead you to the problem. THere’s not enough code up there
to figure out what may be the problem.

Michael