I'm new to model glue. Having a tough time figuring out how to route
when there is a success vs error. For example my "signup" event. A
form posts to this, and I validate, and if validation passes I create
the user and redirect the user somewhere.
If validation fails, I want to redirect the user back to the form. I
think I need to use a named result but can't get it working. My event
declaration looks like this:
<event-handler name="signup">
<broadcasts>
<message name="doSignupForm" />
</broadcasts>
<results>
<result do="page.index" />
<result name="error" do="signupform" />
</results>
</event-handler>
By default, I want the user to go on to the page.index event. But if
there was an error, I want to go to signup form. I think I should
have it as above and then in my controller if validation failed I
would use AddResult("error") ? But it doesn't work. Seems like the
user is always redirected to page.index.
Thanks for any help.
--~--~---------~--~----~------------~-------~--~----~
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
You received this message because you are subscribed to the Google
Groups "model-glue" 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/model-glue?hl=en
-~----------~----~----~----~------~----~------~--~---