bradley.mazurek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-26 19:47 UTC
Restful Rails DELETE Javascript Question...
Hi, Reading over the Restful Rails Development PDF and I had a couple of questions. On pg 13 it says that because DELETE isn''t supported by browsers, the DELETE is faked using client-side Javascript. This implies to me that resource deletion on clients not using Javascript is unsupported. Is this correct? If so, is the expectation that the rise of REST will spur browsers to support the other methods? Thanks, Brad --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It can be faked using a POST (Because DELETE should be protected from bots & co). You can do that with a button_to helper, which generates an all-inclusive POST form including the DELETE method. No JavaScript here. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Be aware that using a button_to [which creates a form] within another form could lead to unexpected results. RSL On 2/26/07, Benoit B. <benoit.benezech-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > It can be faked using a POST (Because DELETE should be protected from > bots & co). You can do that with a button_to helper, which generates > an all-inclusive POST form including the DELETE method. No JavaScript > here. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
take a look on restolog: http://code.google.com/p/restolog/source i have delete with or without JS enabled On Feb 27, 4:47 am, bradley.mazu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> On pg 13 it says that because DELETE isn''t supported by browsers, the > DELETE is faked using client-side Javascript. This implies to me that > resource deletion on clients not using Javascript is unsupported. Is > this correct?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
bradley.mazurek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-27 19:43 UTC
Re: Restful Rails DELETE Javascript Question...
> take a look on restolog:http://code.google.com/p/restolog/source i > have delete with or without JS enabledExcellent. Thanks stoyan and Russell.... Brad --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tuesday 27 February 2007, stoyan wrote:> take a look on restolog: http://code.google.com/p/restolog/source i > have delete with or without JS enabledI''ve had a look and either I don''t understand what I see or I don''t like it. The point of using DELETE or some HTTP method other than GET at any rate for deleting things is that it keeps search engines from following -- "clicking" them. The effect would be, and your routes.rb suggests this, too, that if you let a search engine loose on your app it will gnaw your database clean in no time. Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 2/26/07, bradley.mazurek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <bradley.mazurek-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi, > > Reading over the Restful Rails Development PDF and I had a couple of > questions. > > On pg 13 it says that because DELETE isn''t supported by browsers, the > DELETE is faked using client-side Javascript. This implies to me that > resource deletion on clients not using Javascript is unsupported. Is > this correct? > > If so, is the expectation that the rise of REST will spur browsers to > support the other methods? > >I think that is the hope, that browsers will support the spec. It surprises me that they don''t since the http 1.1 spec is from June 1999 (hasn''t that been enough time to implement it?) and it would seem that is a simple verb (string) change to support it. -- Jeff Barczewski, MasterView core team Inspired Horizons Ruby on Rails Training and Consultancy http://inspiredhorizons.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 28, 6:51 am, Michael Schuerig <mich...-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote:> The point of using DELETE or some HTTP method other than GET at any > rate for deleting things is that it keeps search engines from > following -- "clicking" them.There was pretty good discussion on the problem: http://www.thelucid.com/articles/2006/07/26/simply-restful-the-missing-action "...The delete action is a confirmation of deletion. I don''t think anyone here is advocating deleting records via GET..." --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Wednesday 28 February 2007, stoyan wrote:> On Feb 28, 6:51 am, Michael Schuerig <mich...-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote: > > The point of using DELETE or some HTTP method other than GET at any > > rate for deleting things is that it keeps search engines from > > following -- "clicking" them. > > There was pretty good discussion on the problem: > http://www.thelucid.com/articles/2006/07/26/simply-restful-the-missin >g-action > > "...The delete action is a confirmation of deletion. I don''t think > anyone here is advocating deleting records via GET..."Yes, I see, for /somethings/1;delete requests you''re sending the user on a detour over a confirmation view. I didn''t notice that before. Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---