Just wondering if there is a plugin out there that abstracts the process of deriving the instance of a current resource (or its class) from the current controller name?
Currently I just classify.constantize the controller name, and if that works then I test for the id paramater and load the record if it exists.
Yea, maybe it's a bit weird, but just wondered if someone's been there before and done it properly.
The reason it exists is because I need to know these objects to perform authentication on a granular level but I have about 35 different object classes so it needs to be abstract. I suppose I could assign @item to be the current item in each controller and rely on that but it seems a but unDRY.