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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With