I have a layout with common elements in the side bar per page (some of the elements are common to most pages, some are unique for some pages).
--------------------------------
| | side box |
| | |
| |__________|
| | side box |
| | |
| |__________|
| | side box |
| | |
| | |
--------------------------------
Right now the way I do it is include a shared/sidebar_type
partial from the views. The sidebar
partial further includes the individual box partials that type of page should display.
1) What's the best way to segment and include these partials and customize which boxes of content are shown on the side page based on each page?
2) Best practice for setting objects and passing them onto those partials (the sidebar boxes) for output
For data used by the side boxes I'm referring to here. Should it go in a master controller as global variables which all other controllers inherit? etc.
I'm new to Rails from the PHP world and proper organization of these shared partials is slightly confusing. The way I'm currently passing objects to those box partials seems half-assed.