Forum: Ruby on Rails RJS template / page.insert_html problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
5e518814b76962fdd1ad0e74dfac5ea7?d=identicon&s=25 Martin Gamsjaeger (Guest)
on 2006-05-28 21:30
(Received via mailing list)

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 :-(

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.
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

455ac2a64d06dc8461f4d258d7f7e980?d=identicon&s=25 Michael Trier (Guest)
on 2006-05-29 05:54
(Received via mailing list)
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.

This topic is locked and can not be replied to.