you can also set up a layout in apps/views/layouts/ and put your html template there then in the controller you want to share this template put
layout “nameoflayout”
make sure you have a
yield :layout
where you want the specific methods to show up in. For instance my admin controller shares one layout and each action or method is displayed or “yielded” at the specific point on the layout where I want. Which in my case is in my div#content box.
Typing this on my palm omw home. Write back if you have any questions.
Thomas england
—–Original Message—–
From: Greg Willits
Date: Tuesday, Oct 16, 2007 7:52 pm
Subject: [Rails] Re: Basic Question about Base Files
To: rubyonrails-talk@googlegroups.comReply-To: rubyonrails-talk@googlegroups.com
On Oct 16, 2007, at 10:37 PM, Colin Summers wrote:
> Ooooh, I’m having so much fun with Ruby on Rails.
> I have the students assigning to parents, the parents are able to come
login… it’s great.
> That’s the functional part. As I get more of it working I am sure I’ll
have questions about that.
> Until then:
> What do I do for the “static” files on the site. For every site you
build don’t you have an “About” a “Contact” and “Help” page? Things
right off the root? Right now I have them in the Application directory
and a route points ‘/:action’ to :controller => Application (or
something like that, I’m home now instead of in my office).
> I want them to all have the layout from the rest of the site,
obviously.
> Is there a usual method for this?
My understanding is you still need to (or normally would) use
controller/action.
So if you put those at /company/about, /company/contact you would
still create a Company controller, it just wouldn’t do very much.
As for giving all pages the same look, I’ve been exploring how to do
this in Rails, and just finished writing an article about it (still
some unanswered questions, but I’ll get to those).
http://gregwillits.wordpress.com/2007/10/16/modular-page-layouts-in-
ruby-on-rails/
– gw
–~–~———~–~—-~————~——-~–~—-~
You received this message because you are subscribed to the Google Groups “Ruby on Rails: Talk” group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~———-~—-~—-~—-~——~—-~——~–~—
.