How to ajax highlight a flash[]

Hi,

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:
element.highlight(flash[:notice])

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 http://DevLists.com. Sign up and save your mailbox.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

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.

_Kevin
www.sciwerks.com

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