I’m trying to formulate my thoughts on how views work in RoR and I
understand the basic bits -
- Every controller has its own view defined using rhtml files in the
- There is one “view” file (rhtml) for every in the controller and has
the same name as the method.
- For portions that are common, partials can be used - file names begin
This bit is clear enough to me (though do correct me if something is
wrong in the above statements). Now, I am wondering about how to do
some of the other things that have been asked in a couple of emails
(though I’m slightly confused). Some of the early questions are as
- Which directory/ file should I use to create the HTML that is common
to the whole site. I can create the general layout of the page using
something like NetObjects Fusion (which I use for static sites) and I’m
guessing that I can modify the generated output to include the embedded
- How do we render output from multiple controllers onto the same
page? For example, the 5 most recent news headlines as well as the 5
most recent events, etc.
- I’ve seen a bit about putting things into “shared/partials” and
“views/layouts” and I’m not sure what belongs where :-S
I think my confusion is between “views” and “layouts”… but I just got
hold of the AWDR book (PDF) and also the main article that I found that
explains some of this  and hopefully will be able to understand some
of this a bit better. So, I am reading on but I hope some of you can
explain these concepts as you are applying them.
Anything else that comes to mind at this stage?