[Catalyst] Re: Form validation in insert() and update()?

Matt S Trout dbix-class at trout.me.uk
Mon May 21 00:48:07 GMT 2007


On Sun, May 20, 2007 at 04:14:06PM -0500, Dave Rolsky wrote:
> On Sun, 20 May 2007, Bogdan Lucaciu wrote:
> 
> >On Sunday 20 May 2007 22:58:26 Dave Rolsky wrote:
> >>A couple problems. The biggest is that besides messages, I also pass along
> >>the submitted form data, so the form can be displayed with what the user
> >>submitted. That won't fit in a query string in many cases.
> >
> >if the post is handled by /order/new I usually redirect to /order/15 with 
> >the
> >flash message. I think there's plenty of room in the URL for the
> >altered/created object's primary key
> 
> Yes, that's what I do too.
> 
> I was talking about the case where the form submission _fails_, and you 
> want to send the client back to the form, show them 1+ error messages, and 
> re-populate the form with the data they submitted. That may not fit in a 
> query string in many cases.

I tend to redirect on 'OK' and stay put on 'Apply'.

A failure doesn't redirect.

An 'Apply' of a -create- redirects to an edit form.

Not -exactly- restful but seems to work well.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Catalyst mailing list