Rails – Update a single attribute : link with custom action or form with hidden fields?

Not sure what your routes look like but if you have an update action it should work with the link_to. If you go with the link make sure you use a method of PUT or POST (ideally PUT because it’s an update):

link_to("Unlink your facebook account", user_path(@user, :facebook_uid => nil), :method => :put, :confirm => "Are you sure?")

Leave a Comment