Categories
How-To ruby on rails

Redboxing with Rails: Modal Windows FTW

There’s a great lightbox plugin for Ruby on Rails called Redbox. Unfortunately, it doesn’t work out of the box, but here’s the patch for redbox.js:

Replace:

Element.setTop(window_id, boxTop);
Element.setLeft(window_id, boxLeft);

With:

$(window_id).style.top = boxTop + “px”;
$(window_id).style.left = boxLeft + “px”;

Remove or comment out:

Element.hide(‘RB_loading’);

Remove:

<div id=”RB_loading”></div>