Topic: Generic Destroyer Method - How to specify a table in a link_to?
I'm designing an admin controller that should allow the user to delete many different types of data. I'd like to have a generic destroyer method that can take a classname/table name, and an :id, and delete the specified object from the specified table (so that I don't need a separate method for each class/table).
My problem is that I'm not sure how to pass the classname up through a link_to (I don't want this hardcoded in the view, because then I'd just need a new partial for every class type). Or is there a query I could make on the controller side? Or is there a better way of looking at this? Thanks for any help.