Partial is a presentation fragment, a presentation fragment that is useful in several places and pulled out to remove duplication. However, the bottom line is that presentations, whether standalone or partial, are for presentation.
As you know, controllers are designed to handle logic. However, it is inevitable that you will need some logical processing when presenting the view. So, for example, if you have a part of the presentation that is accessible only to administrators, you can extract this logic to the assistant and keep the presentation "pure" and "presentation only". Helpers will inevitably contain presentation code - html tags, etc., But this is a by-product of their use, and not their main function.
You can also combine two - partial for the presentation of the administrator and another for the presentation of the user and an assistant with logic to determine which one is displayed in a particular situation.
Just my $ .02.
Yardboy Dec 30 '09 at 2:55 2008-12-30 02:55
source share