Rails 3 how do I use link_to to change the value of a boolean in the db?
问题 I'm trying to create a simple link that will allow an admin to approve a user on my website quite similar to what this guy was trying : In Rails 3 how do I use button_to to change the value of a boolean? Here's how it was supposed to work : Admin clicks the link to approve a user The link calls the activate function in UsersController The active function calls that users model the user model updates the approved attribute to true and saves it and here's how I was going to do it in my users