Template question (easy)

J

justingoodman

So I originally took up a project of making a simple blog for myself
and some friends to use to communicate with family while at college.
I've got most of it finished code wise, I am now in the process of
formatting the pages so it is all identical.

I am wondering, in my views folder, I have several .rhtml template
files, is there a way I can just define a single template file and a
load point in the code, and have all my other template files load in
that defined spot on the template file?

If not, is there another solution, or am I simply going to have to copy
and paste my code into all of my template files so they all load the
same page layout?

Thanks,

Justin
 
J

justingoodman

I haven't had much practice with partials yet. I assume from what I
saw, a partial just grabs the little tiny segment of code I have, and
puts it somewhere else. Not entirely sure how to implement that
accurately though.

Any tips or starting places to figure out how to learn it?
 
P

Payton Swick

It sounds like what you're looking for is layouts.

app/views/layouts/*.rhtml

I'm sure there's plenty of information scattered around the web on
using layouts, but you could also check a rails book, like Agile Web
Development with Rails.

Hope that's helpful.

-Payton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,215
Messages
2,571,113
Members
47,713
Latest member
LeliaB1379

Latest Threads

Top