flash[:notice] as coach content...

Hi,

I would like to use flash[:notice] to display coach content, e.g. “It’s generally a bad idea to do [whatever you just did]. Click here to find out why” - which goes to a more complete coaching page on that topic.

My questions are:

  1. Does anyone know of nice snippets for doing that (e.g. script.aculo.us fade in, fade out), and
  2. It seems the (very plain) approach I’m taking doesn’t show up until the page is reloaded. How can I make it show up right when I call it (from controller: flash[:notice] = “It’s generally a bad idea…”

Thanks in advance,

Marc

Hi,

I would like to use flash[:notice] to display coach content, e.g. "It's generally a bad idea to do [whatever you just did]. Click here to find out why" - which goes to a more complete coaching page on that topic.

My questions are: 1) Does anyone know of nice snippets for doing that (e.g. script.aculo.us fade in, fade out), and

this is pretty easy to do with an ajax callback. Just use the visual_effect method on the div that contains your flash message in your ajax method.

2) It seems the (very plain) approach I'm taking doesn't show up until the page is reloaded. How can I make it show up right when I call it (from controller: flash[:notice] = "It's generally a bad idea..."

if you want to show a message immediately (without a complete page reload), you'll need to use an ajax callback.

Adam