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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Martin G. (Guest)
on 2006-05-28 23:30
(Received via mailing list)
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 :-(

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
Michael T. (Guest)
on 2006-05-29 07: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.

Michael
This topic is locked and can not be replied to.