Thank you Yehuda. And because I feel strongly about this, I've made a
patch (which apparently is already marked 'wont fix') at
https://rails.lighthouseapp.com/projects/8994/tickets/3029-patch-non-javascript-dependent-record-deletion-solution
It's got documentation, code, and test changes.

It's not hard to see why this is needed. Very simply, you can't delete
a record with Javascript disabled, and that is very bad!

However, I am also in support of the other solution mentioned in this
thread, of an inline form, with javascript confirmation as well, that
degrades. Some very simple styling, and the Delete button could be
made to look like a link. However, it still means users with
Javascript disabled could mistakenly click delete and its gone. So I'd
still prefer the delete action solution, because, as Chris said so
well, "some resources are too important to delete without
confirmation".

And as a reminder:

>> "It makes poor and slow UI. " - Pratik

No, it's not. Users with Javascript on still get the Javascript
prompt, and when accepted, goes right ahead and hits the destroy
action (they don't need to look at the delete action). This case only
handles where Javascript is disabled.

>> "the scaffolding in core doesn't need anything else." - Michael

But the core problem behind this change would still be present without
changes.

And it's not a lot of scaffolding changes. It's one existing line
change, 3 new controller lines, and one small view file.

The rest of the code happens in tests/routing to allow the
delete_users_path(user) resources without having to add it to each
resource in routes.

It's not a big ask considering some of the other scaffold changes that
have been proposed in another thread (support for _form partial,
changing all HTML markup).

Regards
Kieran

On Aug 10, 11:39 pm, Yehuda Katz <wyc...@gmail.com> wrote:
> 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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to