RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: reedlaw
Site: www.reedglaw.com
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
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