# Yellow Fade Technique After A Redirect?

**URL:** <https://www.ruby-forum.com/t/yellow-fade-technique-after-a-redirect/80977>\
**Category:** Rails\
**Created:** [January 2, 2007, 6:43pm UTC](https://www.ruby-forum.com/t/yellow-fade-technique-after-a-redirect/80977 "2007-01-02T18:43:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![starmaerker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e9bcb4/32.png) [@starmaerker](https://www.ruby-forum.com/u/starmaerker)\
**Post date:** [January 2, 2007, 6:43pm UTC](https://www.ruby-forum.com/t/yellow-fade-technique-after-a-redirect/80977/1 "2007-01-02T18:43:09Z")

</div>

Hello,

I am having difficulty implementing the yellow fade technique after a  
redirection. All the examples I have seen use it immediately after  
editing an in-place form via Ajax. I would like to use it after  
editing a form on a different page. Is it possible to do this in a  
reliably cross-browser way?

To be specific, my index action shows a list of people. When you  
click on a person you are taken to a new page to edit the person’s  
details. When you have made your changes and submitted that form,  
you are redirected back to the index action. I would like, at this  
point, to highlight briefly the person who was just edited.

I can’t do an in-place form for editing the person right there on the  
index page because the person model has many attributes and the  
fields need an entire page to themselves to be legible.

Any help would be much appreciated.

Thanks and regards,  
Andy S.

---

<div class="post-metadata">

**Author:** ![starmaerker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e9bcb4/32.png) [@starmaerker](https://www.ruby-forum.com/u/starmaerker)\
**Post date:** [January 2, 2007, 7:55pm UTC](https://www.ruby-forum.com/t/yellow-fade-technique-after-a-redirect/80977/2 "2007-01-02T19:55:31Z")

</div>

Put the person’s ID in the flash, and do thustly:

window.onload = function() {  
new Effect.Highlight(‘domId\_\<%= flash[:person\_id] %\>’, {duration: 1,  
startcolor: #cccccc, endcolor: #dddddd});  
}

Should do the trick. This is all from my head and with the documentation  
below. Of course, make changes as you need and see fit.

[http://wiki.script.aculo.us/scriptaculous/show/Effect.Highlight](http://wiki.script.aculo.us/scriptaculous/show/Effect.Highlight)

Jason

---

<div class="post-metadata">

**Author:** ![starmaerker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e9bcb4/32.png) [@starmaerker](https://www.ruby-forum.com/u/starmaerker)\
**Post date:** [January 2, 2007, 7:57pm UTC](https://www.ruby-forum.com/t/yellow-fade-technique-after-a-redirect/80977/3 "2007-01-02T19:57:31Z")

</div>

You could simply include the id of the record just edited in the  
redirect back to the list. Then in the list view check for the  
presence of that parameter and highlight the element with a matching id.

–  
Building an e-commerce site with Rails?  
[http://www.agilewebdevelopment.com/rails-ecommerce](http://www.agilewebdevelopment.com/rails-ecommerce)
