Forum: Ruby on Rails using window.onload commands the 'rails way'

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.
72e9277a5fd803ebd50c28f940ec81eb?d=identicon&s=25 Michael (Guest)
on 2007-01-22 16:51
(Received via mailing list)
I'm trying to integrate niftycube
(http://www.html.it/articoli/niftycube/index.html) into my rails app.
It however requires that you specify window.onload commands for each of
the rounded areas which you wish to use.

Given that my app is setup using layouts, I was wondering if anyone had
any good ideas of how to incorporate this into the application.

One approach that comes to mind is to do <%= javascript_tag
"window.onload=function() {Nifty('div#box','big');}" %> inline in the
view, but this doesn't seem to work if there are multiple divs you want
rounded in one view, (the onload function gets over ridden). I guess
you could also add an element to an array every time you want something
rounded but this seems cumbersome.

Any ideas?
This topic is locked and can not be replied to.