Hi Miles,

I like to use "REST light" :)  That is: I make sure any data push,
modification and similar actions are POST and any data retrieval is
GET.

create, update, delete = POST
find, list, get, show... = GET

It makes is a bit cleaner in my head.
I do this for non-ajax calls and ajax calls alike. It is also a bit
harder for a user to "re-submit" a POST by mistake using back buttons
and things like that.

jQuery makes it very easy, as you probably know:
$.post('/controller/action', $('form').serialize(), function(data)
{respond_to_post();});

Serializing forms as above makes complex ajax posts really painless.

/Martin


On Jan 14, 5:49 am, Miles J <[email protected]> wrote:
> Simple question to anyone who uses CakePHP and jQuery. Do you pass
> your post variables as post, or as the arguments of the action?
>
> When you make ajax calls, do you call it like this:
>
> /ajax/delete/123/
>
> Or:
>
> /ajax/delete/
> POST: id=123
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to