I'm following Railcasts #147 using Rails 4 instead of 3.
The method below is not passing in Rails 4. So far all, all is working except for updating the databse with the new sorted position. Any idea how I can mass update the records?
def sort
params[:faq].each_with_index do |id, index|
Faq.update_all({position: index+1}, {id: id})
end
render nothing: true
end
Much appreciated.