Friday, January 20, 2006

Creating Layouts

first open the *_controller.rb you want to edit. In my case, its site_controller.rb

and add the custom layout
class SiteController < ApplicationController
# creating the layout
layout "my-layout"


then create your template in views/layout/my-layout.rhtml and whereever you want the content of the page to appear, insert the following line
<%= @content_for_layout %>

0 Comments:

Post a Comment

<< Home

eXTReMe Tracker