Forum: Ruby on Rails Doing destructive actions with a GET request

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0ccfc4935cd968d289decc405604a2ca?d=identicon&s=25 Matthew Law (Guest)
on 2006-04-12 16:19
(Received via mailing list)
I know that you should always use a POST to perform actions that are
destructive.  I intend to break this rule and use a GET, but before I
do,
I'd like to know if there is a better way of doing this:-

I have an account edit form for the user to make changes to their
profile.
 They have to be logged-in to do this.  The problem is I have a
file_column field within the form which is storing an image - their
logo,
avatar, or whatever, and I need a button right there in the middle of
the
form for them to delete their logo if they wish.  Obviously I can't nest
a
form within a form, so I was going to make this a link to a
'/user/delete_image' action.

Is there a better way of doing this (without heavy javascript,
preferably)?

TIA,

Matt.
30269682335f1fb247d71969fa715b5e?d=identicon&s=25 Roberto Saccon (rsaccon)
on 2006-04-12 16:26
(Received via mailing list)
just "post" a link_to_remote
This topic is locked and can not be replied to.