views:

271

answers:

2

I've been a .Net developer for the past seven years or so, and been working with ASP.Net for the last couple of years. I'm now using Ruby on Rails for some projects, and I'm wanting to know if there is something in Ruby on Rails that lets you do master page type stuff?

Basically, I want a way to provide a consistent look and feel for the site with a header and footer and so on, and then just have each page put its content inside of that. How do you accomplish this?

+2  A: 

You should start by reading the rails documentation.

But the whole of it.
Not only the rendering part, which includes the layouts (equivalent of master).

Damien MATHIEU
A: 

in your rails project in app/layouts/application.(html.erb|html.haml), this is the layout or equivalent for master. You can also create other layouts and specify the layout to use for each action :

render :index, :layout => "awesome"

Or specify the layout for a whole controller :

class PostController < ActionController::Base
  layout "super_awesome"
end
Mike