To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / plugins / redmine_bibliography / app / controllers / authorships_controller.rb @ 1375:c28ce1a71a22
History | View | Annotate | Download (467 Bytes)
| 1 | 328:aed18b463206 | luis | class AuthorshipsController < ApplicationController |
|---|---|---|---|
| 2 | |||
| 3 | 1364:4d5d25039a5f | luis | def sort |
| 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
|
||
| 15 | 328:aed18b463206 | luis | end |