Forum: Ruby on Rails Yellow Fade Technique After A Redirect?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
72ee7b478a235f646c3495f03ebbe676?d=identicon&s=25 Andrew Stewart (Guest)
on 2007-01-02 18:43
(Received via mailing list)

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 Stewart
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-01-02 19:55
(Received via mailing list)
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.

Db303dc84d03a992b33cd3ac978f89ae?d=identicon&s=25 Benjamin Curtis (Guest)
on 2007-01-02 19:57
(Received via mailing list)
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?
This topic is locked and can not be replied to.