Solutions Log

So I only have to figure things out once.

Making a POST Link in Rails

You know you shouldn’t be using GETs (URLs) for deleting things, right? Here’s how you do it in Rails:

<%= link_to "Destroy account", { :action => "destroy" }, :confirm => "Are you sure?", :post => true %>

(example is from the API docs)

:post => true! That’s awesome. Of course, it’s not unobtrusive, but maybe UJS could fix that.

Comments