David Kimura PRO said 2 months ago on Drag and Drop with Hotwire :
The object that you're calling insert_at is nil. Try logging what the item is to make sure that it is being found. It's currently returning nil, so you should trace upwards to see what the params[:sgid] is being set to. If the params[:sgid] is nil, then you go upwards from there to what's calling the controller and find out why it is nil.