I am learning how to think RESTfully and in my quest for improvement I
need help with the issue I am facing.
I have a RESTful model “User” and I want to add a link on the listing
(index) page that is a one-click to disable/enable that user i.e. simply
toggle the active column to the correct value. Since I am just updating
a column in the object it seemed to me that this should be a simple PUT
request with the correct value for the column (true/false). However, I
can’t figure out how I can add the value of “active” to the request
using a link_to and the REST routes helper methods.
<%= link_to ‘Disable’, user_path(user), :method => :put %>
Is as far as I have been able to get. I did try changing the url to use
the raw hash but that didn’t work either. Could someone please give me
some direction on this?
Oh yeah, I do realize I could create a new member route for this, but
somehow it doesn’t seem “correct” considering it should just be a simple