DBServer/app/controllers/documents_controller.rb
### called in update document when the document is re-ordered
called in update document when the document is re-ordered
called in update document when the document is re - ordered
def sort_pages
    params[:page].each_with_index do |page_id, position|
      page=Page.find(page_id)
      page.position=position
      page.save!
    end
    render :nothing => true
  end
def sort_pages params [ :page ] . each_with_index do | page_id , position | page = Page . find ( page_id ) page . position = position page . save! end render :nothing => true end
called in update document when the document is re-ordered
called in update document when the document is re - ordered