I think I might be approaching this in the wrong way, so I would appreciate any comments/guidance. Hopefully I can explain coherently enough what I am trying to achieve:
I want to create a block of HTML (e.g. a box containing a user's profile), which I will load as part of my layout on most pages that I generate.
I would also like to be able to re-generate the content within this box on its own from a separate URL. This is so I can update the box with an AJAX call.
I don't want to duplicate the code that creates this HTML.
I appreciate that I could initally load this box using an AJAX call, but that would seem to me to add an unnecessary call to the server?
The way I thought I could do it is by having a method in my controller that just renders this block of HTML, but how would I then request the output from this method within another controller / view?
How would you approach this?
Thanks in advance