Destroy.js, ActionView::Template::Error (undefined method `model_name'

I am getting this error once I changed some buttons to use js instead of making regular requests. I don’t know if this is related to not being able to get link_to to generate a DELETE request (button_to does the right thing). I may be missing some setup code?