Hi All,
I'm currently managing multiple models from a single SITE MANAGER page. I have the following relationships:
Sites -> Buildings -> Meters -> Values
Beside each "Sites" item I have "Edit | Delete | Add Building" Beside each "Building" item I have "Edit | Delete | Add Meter" Beside each "Meter" item I have "Edit | Delete | Add Value" Beside each "Value" item I have "Edit | Delete"
At this point I have one frankensteined controller called "SiteManagerController" which manages this page. I simply have a method (and corresponding route in the routes file) like so:
add_site
add_building_to_site
add_meter_to_building
delete_site
delete_building
delete_meter
What I'm wondering, however, is whether or not there is a quality mechanism by which to use the existing item controllers CRUD methods while being able to render the appropriate RJS file for the "SiteManager" page and controller?
It would be nice if I could somehow route to the original controller (so as to not have to rewrite all the methods manually) while also having rails redirect control (not just visually, but contextually) back to the "SiteManager" controller after creating or deleting. Keep in mind that I'm not dealing with forms, but simply an INDEX page and multiple "link_to_remote"s
I'm quite possibly asking the wrong question, so do consider that...in any event, I'm open to suggestion.
Best.