view plugins/redmine_bibliography/app/controllers/authorships_controller.rb @ 1503:523f55b47b98 cannam

Whoops, call the right method why not
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 21 Mar 2014 13:13:52 +0000
parents 4d5d25039a5f
children
line wrap: on
line source
class AuthorshipsController < ApplicationController

    def sort
        @authorships = Authorship.find(params['authorship'])

        @authorships.each do |authorship|

            # note: auth_order is usually called position (default column name in the acts_as_list plugin )
            authorship.auth_order = params['authorship'].index(authorship.id.to_s) + 1
            authorship.save
        end

        render :nothing => true, :status => 200
    end
end