Delete div content automatically after 2 seconds

The best way of doing this is in Javascript. Scriptaculous is purely an effects framework and has in and of itself nothing to do with Rails. If you want to fade out/slide out, etc, then you can add such an effect later.

For just deleting the error div after 2 seconds, you’ll need to use this Javascript (using Prorotype):

setTimeout(2000, deleteDiv(‘div_id’));

function deleteDiv(div) {
// Effect call can go here

Element.remove(div);
}

Where this goes of course depends on how the error div is displayed. If this is a full page refresh, then a simple tag after the div will work.

Jason