Zbigniew Lukasiak wrote on 03/03/2009 02:53 PM: >> If you use CatalystX::CRUD::REST, you can do: >> >> # POST /foo -> create new record >> # GET /foo -> list all records >> # PUT /foo/<pk> -> update record >> # DELETE /foo/<pk> -> delete record >> # GET /foo/<pk> -> view record >> # GET /foo/<pk>/edit_form -> edit record form >> # GET /foo/create_form -> create record form >> >> CatalystX::CRUD::REST uses the C::R::REST::ForBrowsers feature of >> 'x-tunneled-method' param to support PUT and DELETE via POST. > > And where do the forms submit? I mean what is their action address? > Do they submit to themselves - or does edit_form submit to > /foo/<pk>?x-tunneled-method=PUT and create to /foo both with POST > method? And it is the second - then what do you do when the form > parameters are incorrect and you need to redisplay the form?
using the CXC REST API: if you GET /foo/1234, then you must PUT /foo/1234 to save it. (or POST /foo/1234?x-tunneled-method=PUT -- although I always put the x-tunneled-method value in a hidden input body param, not as part of the URL). if you GET /foo/create_form, then you must POST /foo. When the form is redisplayed on validation error, it just retains the original action. -- Peter Karman . pe...@peknet.com . http://peknet.com/ _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/