# Flash\[:notice\] as coach content

**URL:** <https://www.ruby-forum.com/t/flash-notice-as-coach-content/113423>\
**Category:** Rails\
**Created:** [August 30, 2007, 11:31pm UTC](https://www.ruby-forum.com/t/flash-notice-as-coach-content/113423 "2007-08-30T23:31:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcbey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@marcbey](https://www.ruby-forum.com/u/marcbey)\
**Post date:** [August 30, 2007, 11:31pm UTC](https://www.ruby-forum.com/t/flash-notice-as-coach-content/113423/1 "2007-08-30T23:31:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marcbey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@marcbey](https://www.ruby-forum.com/u/marcbey)\
**Post date:** [August 31, 2007, 5:24am UTC](https://www.ruby-forum.com/t/flash-notice-as-coach-content/113423/2 "2007-08-31T05:24:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marcbey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@marcbey](https://www.ruby-forum.com/u/marcbey)\
**Post date:** [August 31, 2007, 5:51am UTC](https://www.ruby-forum.com/t/flash-notice-as-coach-content/113423/3 "2007-08-31T05:51:26Z")

</div>

On 8/30/07, Marc B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://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
