ruby on rails - Using increment(attribute) to set value for user's rating -


I'm thinking of writing an app with the question and answering the model. In the north there is a salary increase feature that can change any rating to change the value. So if I click on the answer that someone else makes the post, the answer will show 1 point.

But, how can I / I use the whole user to increase ratings? In essence, it is similar to Stackoverflow. If you answer my answer above, then my user rating goes up. I want the same functionality.

Do you want to increase the user while increasing?

  answer.increment (: vote) user.increment (: rating)  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -