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

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.
Michael (Guest)
on 2007-01-22 17:51
(Received via mailing list)
I'm trying to integrate niftycube
( 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.