On Thu, Jul 10, 2008 at 1:46 PM, jerry <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Say the change password page is at GET h.url_for(controller='account',
> action='password') and the new password is received via POST. After
> updating the password in db the user is directed back with
> redirect_to(controller='account', action='password').
>
> But now how to display a _one-time_ message on the redirected page
> telling the user that her password has been changed successfully?

With WebHelpers 0.6:

# myapp/lib/helpers.py
from webhelpers.pylons import Flash
flash = Flash()

# Update action
h.flash("Password changed.")
redirect_to(...)

# Site template
<%  flash_messages = h.flash.pop_messages()  %>
% if flash_messages:
<ul id="flash-messages">
% for msg in flash_messages:
<li>${msg}</li>
% endfor   msg
</ul>
% endif   flash_messages


# Stylesheet
ul#flash-messages {
    color: red;
    background-color: #ffffcc;
    font-size: larger;
    font-style: italic;
    margin-left: 40px;
    padding: 4px;
    list-style-type: none;
}

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to