How to ajax highlight a flash[]


I want to make a flash[] highlighted for let’s say 5 seconds when some
action is invoked.

In the controller, I have:
flash[:notice] = “error”

In the layout, I have:

<%= flash[:notice] %>

I don’t know how to use ajax with the flash. I tried something like:

without any success. Do I have to put it inside a

with an id or
class? Can somebody help me?

Thanks a lot.

On Friday, July 28, 2006, at 11:05 PM, Eric B. wrote:

Posted with Sign up and save your mailbox.

Rails mailing list
[email protected]

I stuck this at the bottom of my ‘application.rhtml’ file…

<%= javascript_tag(“new Effect.Highlight(‘flash’);new
Effect.Fade(‘flash’, {duration:10});”) if flash %>

This highlights the flash, if there is one, and then it fades out
completely over a longer period.


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