I'm building a project management application in Ruby on Rails (3.0). I am trying to figure out how to update all the tasks of a project on update of a project column. Here is the situation.
I am listing all the projects, as expected, in /projects/index.html.erb. I'm using a sortable list (from Ryan Bates tutorial) to update the project.position field as the user sorts the list.
When the project list gets sorted the project.position
column gets updated on each sort, I also want to update the task.project_position column of all the tasks that belong_to
that project. So task.project_position = project.position.
I am guessing that this is done through an after_save in the project model but I could be totally wrong.