There is a list of tasks (Task class instances).
Each task has a priority ( integer
type field).
On the html page you need to click on the buttons "up" "down" to increase / decrease the priority of the task.
I wanted to do something like this (increase the priority by clicking on %i.fa.fa-caret-up
)
= link_to task, remote: true, method: :put do %i.fa.fa-caret-up
But it's not right.
There was also a council to make a TaskPrioritiesController
controller, but I haven’t figured out that yet, and I don’t understand how this controller will work.
Actually, the question is, how do I properly organize a change in the priority
parameter of an instance of the Task
class?
ps For the literature on this topic will also be grateful