I have a confusing problem using flash[''notice''].
I have a rescue clause in an exception that sets the flash to one
message if an error occurs.
Outside of that clause, I set the flash to another value if the block
was successful.
If the exception is rescued, the flash is set to the successful
message instead of the rescue message (even though the code inside the
rescue clause is executed).
Any ideas as to why flash[''notice''] isn''t being set
to the rescue message?
Simplified code below:
begin
# potential error code here
rescue NoMethodError
# this redirection does occur (but the flash is set using the
statement after the exception block)
flash[''notice''] = ''Email addresses must be
included to invite users.''
redirect_to :controller => ''settings'', :action
=> ''add_user'',
:id => @params[:id]
end
end
# send the user back to the settings index view
flash[''notice''] = ''Invitations have been
sent.''
redirect_to :controller => ''settings'', :action =>
''index''
--
Derek Haynes
blog - http://itsderek23.blogspot.com
Cell - 404.593.4879