Newbie to Rails, been playing, and trying to understand something about the convention & MVC approach. Coming from original object background, there is something bothering me with the rails paradigm and I can't find a good suggestion on the rationale / best approach.
Partials are only for rendering views? It does not 'call the controller'.
Let me illustrate: Say a home page that has 3 objects, 3 controllers and 3 sets of views
- User
- Address
- User History
If I want a logged in home page which actually displays content from all models I seem to have to create say a 'site controller' and view, that is the home, page, but I have to replicate 'logic' in the site controller to setup variables for say user, address and user history that are then accessed via the various partials/forms.
In testing I have setup 3 sets of tests to get all the views and data working. But in the combined home page I seem to have to replicate controller logic into "site" central/home page.
In an "object world" my brains says I would have the ability to embed controller calls to support views so I can simply reuse address, user and user history controllers. * Or am I completely missing something as to how this works. Welcome views of experts or direction on what I'm mis-understanding.*
These examples seem too re-enforce my point and dong seem to deliver the solution
Cheers Ben