Good morning, I have a situation where I want to display composite views (a view for an object inside a view for its parent object). I have a class Connection that has a Profile associated with it. Profile can be one of a number of different subclasses (AProfile, BProfile, CProfile). I also have views associated for each of the profiles, within a "template" directory under the "views/connection" directory. The way I've tried to go about solving this is to make a view.html (associated with the view() method in the controller) as a base template with a block for "profile_section" inside of it. Then, in each of the profile templates, I extend view.html and then fill out the block for the profile.
The problem I am now facing is how to properly route to the right template file from within the controller's view method. I know I could just create a new method in the controller for each profile type, but I'd rather not do that if possible. I also think that a simple redirect is not the right solution here. Can anyone advise as to the best way to do this? Or am I just on the wrong track with the whole "extend" idea? Thank you, Matt