Use flash.now instead of plain flash when you do the assignment.
------ from the API docs
now()
Sets a flash that will not be available to the next action, only to
the current.
flash.now[:message] = "Hello current action"
This method enables you to use the flash as a central messaging system
in your app. When you need to pass an object to the next action, you
use the standard flash assign (=). When you need to pass an object
to the current action, you use now, and your object will vanish when
the current action is done.
found a solution.... but I have to understand why it runs...
the issue was not the display of the flash notice in the home page,
but the redirection to the home page from within the rjs file
in my rjs file I need to write
page << "window.parent.Shadowbox.close();"
page << "window.parent.document.location.href = '#{root_url}'"
this close the Shadowbox window and redirect to the home page
I cannot use the standard
page.redirect_to root_url
I beive it's related to the Shadowbox displayed within an iframe....