jquery ui - Sortable in Rails 4 -
i'm following railcasts #147 using rails 4 instead of 3.
the method below not passing in rails 4. far all, working except updating databse new sorted position. idea how can mass update records?
def sort params[:faq].each_with_index |id, index| faq.update_all({position: index+1}, {id: id}) end render nothing: true end
much appreciated.
in case wondering, worked me in rails 4:
def sort params[:video].each_with_index |id, index| video.update(id, position: index+1) end render :queue end
Comments
Post a Comment