I am in favor of a standard delete action, analagous to new and edit. I can't think of a good reason not to have it--it shows good practice and isn't exactly a new concept. We have new and edit as HTML precursor actions for the POST and PUT verbs, why not delete as HTML precursor for DELETE. One of the biggest wins of Rails is conventionality; when you come into a new Rails app, you don't have to wonder what the edit action is called. Why not extend this to delete confirmation screens as well?
-- Yehuda MatthewRudy wrote: > I think this is something that is always annoying. > Namely I have to reinvent a convention to handle this. > > Something like "pre_delete" with a GET > - this is just a proper delete form > and "delete" with a DELETE > - this does the delete > > but I think we deserve to have this baked into rails. > > I think it'd be cool if; > GET /posts/delete mapped to the "pre-delete" action > DELETE /posts/delete mapped to the "delete action" > > thereby, > with a "link_to "delete", :method => :delete" > you automatically fall back when javascript is disabled. > > Boom. > > On Aug 10, 1:20 am, Kieran P<kieran...@gmail.com> wrote: > >> Hello, >> >> The generated scaffold relies on Javascript enabled to be able to >> delete a record, which prevents anyone with JavasScript disabled to >> delete it. >> >> I've hacked a solution with a delete action in one of my projects, >> which works nicely, and cleanly. Basically, the link still have >> Javascript which will work if enabled, but the url of the link goes to >> a delete action, with a form that confirms the user wants to delete >> (instead of a Javascript prompt). >> >> Only took 3 new controller lines, 6 new view lines, 1 changed view >> line, and a route :member. >> >> Is this something that people would like to see in Rails 3? >> >> Regards >> Kieran >> > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---