RailsCasts Pro episodes are now free!

Learn more or hide this

Reed G. Law's Profile

GitHub User: reedlaw

Site: www.reedglaw.com

Comments by Reed G. Law

Avatar

No it doesn't but it's pretty easy to do without the 'acts_as_list' gem.

def sort_figures
@report = Report.find(params[:id])
params[:figures].each_with_index do |id, index|
@report.figures.find(id).update_all({position: index+1})
end
render nothing: true
end