comparison plugins/redmine_bibliography/app/controllers/authorships_controller.rb @ 1364:4d5d25039a5f luisf

Fixes Bug #668 - reordering of authors in the publication's detail view is working again.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 19 Aug 2013 15:47:51 +0100
parents b4b72f1eb644
children
comparison
equal deleted inserted replaced
1363:855b4ae5ecdd 1364:4d5d25039a5f
1 class AuthorshipsController < ApplicationController 1 class AuthorshipsController < ApplicationController
2
3 def index
4
5 end
6
7 2
8 def update 3 def sort
9 end 4 @authorships = Authorship.find(params['authorship'])
5
6 @authorships.each do |authorship|
7
8 # note: auth_order is usually called position (default column name in the acts_as_list plugin )
9 authorship.auth_order = params['authorship'].index(authorship.id.to_s) + 1
10 authorship.save
11 end
12
13 render :nothing => true, :status => 200
14 end
10 end 15 end