[LRUG] REST and Delete without JavaScript

Tom Stuart tom at experthuman.com
Fri Mar 27 04:51:17 PDT 2009


On 27 Mar 2009, at 11:41, Simon Sebright wrote:
> I guess the non-JS case needs a form with a POST action, which could  
> work just as well with JS via Ajax.  Then it seems a shame to have  
> bypassed the lovely :method => :delete!

Yes, something like button_to .. :method => :delete is your best bet.  
Visual design considerations aside (!), it's a good convention for  
"normal links" to only be used for GET requests, and for any controls  
that "do something" (i.e. POST/PUT/DELETE) to be rendered as buttons  
or images so that users have a sense that they're performing an  
explicit action rather than just navigating somewhere.

Cheers,
-Tom



More information about the Chat mailing list