For some reason, which I cannot detect, no flash notices that I set
prior to redirects are available after the redirect.

This standard "forgot password" action as an example:

 def forgot
    if request.post?
      user = User.find_by_email(params[:user][:email])
      if user
        user.create_reset_code
        flash[:notice] = "A reset email was sent to #{user.email}"
        redirect_back_or_default('/')
      else
         flash[:notice] = "The email #{params[:user][:email]} does not
exist in system"
         redirect_to forgot_path
      end
    end
  end

If I enter a bad email address, the forgot action/view should redisplay
with the flash message. Up until a little while ago, it did. Something
changed, but I am not sure what it is. Flash messages that are set
before renders do display (my layouts contain the display of the flash
message, so are available on most every page).

Using the debugger, I have verified that just after the flash[:notice]
statement, the flash hash is set correctly. But when processing returns
to the forgot method after the redirect, the flash hash is empty. So it
seems that the message is not making to the session, or is not being
restored from the session.

Sessions are working properly otherwise.

Any thoughts would be greatly appreciated.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to