Many of the screens in the app I’m working on are “portal” views with
little sidebar nuggets of information from elsewhere in the app.
I thought components would be perfect for that. For example for a
summary of user activity I could render_component(:controller => ‘user’,
:action => ‘stats_box’) or something similar.
The problem is that I have my page’s standard header and footer in
application.rhtml. When I render_component, it is rendered inside the
application.rhtml template. Since that contains header and footer, I
have nasty stuff like and in the middle of my page!
Of course I can get rid of application.rhtml and put my header and
footer in controller_name.rhtml or an explicit layout name but that
seems to violate DRY.
I must be missing something… any input appreciated! Thanks!