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....




On 29 juin, 14:29, Mukund <[email protected]> wrote:
> 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.
>
> --------
>
> On Jun 29, 3:18 pm,Erwin<[email protected]> wrote:
>
> > I register a user in with an Ajax request
>
> > after saving a user, and setting the flash[:notice] = "welcome
> > message", I perform the rendering
>
> >          format.js  {
> >            render :update do |page|
> >              page << "window.parent.Shadowbox.close();"
> >              #page.reload (?)
> >              page.redirect_to  root_url)
> >            end
> >          }
>
> > in my home page view, I have  :
>
> > <div id="content">
> > <% if flash[:notice]  %><div class="notice" id="flash"><%= flash
> > [:notice] %></div><% end %>
>
> > but when displayed the notice doesn't appear ...
>
> > I need to perform manually a page reload in the Firefox browser to see
> > the notice displayed...
>
> > iI tried to insert a page.reload in the js rendering but it does not
> > solve the problem...
>
> > what are you advices ?
>
> > thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to