[LRUG] REST and Delete without JavaScript

Simon Sebright simonsebright at hotmail.com
Fri Mar 27 04:41:45 PDT 2009


Hi,

Perhaps this is already well-known.  I am fairly new to Rails and am working on an app which uses a RESTful style.  I want to offer Delete options for the various objects and have first done this with the link_to function with :method => :delete.

However, with JavaScript turned off, this is just a link to the "showing" of an object.

Now, I know it is not a good idea simply to have a fixed GET link to delete something, but want to offer a solution that works both with and without JavaScript enabled on the Client Browser.  Is there an established idiom for this?

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!

Any pointers?

Thanks,
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20090327/28fceab5/attachment.html>


More information about the Chat mailing list