Learning from typo

i have a copy of the typo source on my desktop that i am going through
just to get a better understanding of the rails framework and ruby
itself. i’m fairly new to everything so it has proved to be very helpful
and very inspiring.

i’m stuck on a part though. i was trying to figure out how everything on
the sidebar works. i found the components folder and started looking
through that. i have a basic understanding, but i can’t find the
“setting” method defined anywhere. that seems to be the main thing i
don’t really understand how it works.

also, i’ve been reading the agile web book and it talks about
components as if they were’really recommended for use. what would be an
alternative of doing something like this if you didn’t use components?

Components seem to be on their way out. Try partials instead. I think
the new app tutorial in the 2nd Ed. of the Agile book uses partials.

Keeping view code separated out and reusable by various other
templates is pretty much the point of partials. I can’t do this topic
justice like Dave T. can though. :slight_smile: If you have the 2nd. Ed. of
the Agile book, p. 119 of the PDF has a solid introductory discussion
with examples.

(BTW, I have nothing to do with the book. It’s just good, so I recommend
it.)

-TJ

for partials, is there a way to keep their code separate or is that just
something that needs to be in the parent method.

TJ Stankus wrote:

Components seem to be on their way out. Try partials instead. I think
the new app tutorial in the 2nd Ed. of the Agile book uses partials.

thanks TJ. fortunately i do have the book. i will check it out.

TJ Stankus wrote:

Keeping view code separated out and reusable by various other
templates is pretty much the point of partials. I can’t do this topic
justice like Dave T. can though. :slight_smile: If you have the 2nd. Ed. of
the Agile book, p. 119 of the PDF has a solid introductory discussion
with examples.

(BTW, I have nothing to do with the book. It’s just good, so I recommend
it.)

-TJ