Mercurial > hg > soundsoftware-site
annotate plugins/redmine_bibliography/app/controllers/authorships_controller.rb @ 1519:afce8026aaeb redmine-2.4-integration
Merge from branch "live"
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:34:53 +0100 |
parents | 4d5d25039a5f |
children |
rev | line source |
---|---|
luis@328 | 1 class AuthorshipsController < ApplicationController |
luis@328 | 2 |
luis@1364 | 3 def sort |
luis@1364 | 4 @authorships = Authorship.find(params['authorship']) |
luis@1364 | 5 |
luis@1364 | 6 @authorships.each do |authorship| |
luis@1364 | 7 |
luis@1364 | 8 # note: auth_order is usually called position (default column name in the acts_as_list plugin ) |
luis@1364 | 9 authorship.auth_order = params['authorship'].index(authorship.id.to_s) + 1 |
luis@1364 | 10 authorship.save |
luis@1364 | 11 end |
luis@1364 | 12 |
luis@1364 | 13 render :nothing => true, :status => 200 |
luis@1364 | 14 end |
luis@328 | 15 end |