FAQ

Iain wrote:
Hello all,

So we are having a discussion @work about basic add/edit functions. We
currently have currently two lines of thoughts on handling it.

1. Have separate actions for adding and editing e.g.

# add
/app/notice/add_new (POST To) /app/notice/process_add_new

# edit
/app/notice/*/edit (POST To) /app/notice/*/process_edit

2. Have a shared edit action with an if ( $c->req->method eq 'POST' )
check.

# edit
/app/notice/*/edit (POST Back to) /app/notice/*/edit

There currently doesn't look like much difference in lines of code to
manage.

Just wondering if anybody has any thoughts/experience, pros/cons best
practice etc of either approach.

Actually, I like option 2 best. So I suppose I'm asking for reasons why
we shouldn't use option 1 :-)
If you're using Javascript for your forms you're 95% of the way to
Catalyst::Controller::REST. POST = create, PUT = edit, GET & DELETE
work out great... A much cleaner solution IMHO.
Mark

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 11 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMar 3, '09 at 3:33p
activeMar 4, '09 at 7:12a
posts11
users6
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase