noob question - approaches to using layouts?

I'm just getting started with interface design in rails. One thing I've noticed is that the scaffold process generates a layout for each object it scaffolds. Is there a way to avoid this? Or is there a better way to handle the DRY problem created by having multiple layout files?

What I'd really like to do is have the ApplicationController assume a standard layout (layout "main"), and then have every controller use that layout unless overridden. But the default behavior of render seems to be to check for the existence of a layout before checking to see whether a layout declaration is in force.

I've been looking online, but haven't found a really good discussion of best practices for dealing with sites that will have 2-3 standard layouts that all controllers should use. Can anyone point me in the right direction?

Hi Z,

I'm just getting started with interface design in rails. One thing I've noticed is that the scaffold process generates a layout for each object it scaffolds. Is there a way to avoid this?

No.

Or is there a better way to handle the DRY problem created by having multiple layout files?

Just rename the first one 'application.rhtml' or 'application.html.erb' and delete any others created for you as you scaffold in the future. The layout named 'application...' will be used as the default. You can specify different layouts at the controller and/or method level when you want Rails to use something else.

HTH, Bill