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.usfade 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

I think flash[:now] will do what you need.

On 8/30/07, Marc B. [email protected] wrote:

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.

  1. 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs