Topic: 2 layout design

Hey Guys,

I need your help. I have 2 layout design the main page and the sub page, the defferent between the two is the subpage design has a round corners or curve background for the content and the main page has no curve background or no round corners for content. How do I convert it into ror? Do i need to make a 2 page main page and sub page for the layout? example:I want to choose either the main page design or the sub page design of this page.


I just want to know more how to avoid DRY on making ruby on rails layout.

Re: 2 layout design

Not sure if I understand completely, but you can specify the name of the layout to be used in the controller. For example:

class MyController < ApplicationController
  layout "subpage"

You can also specify the layout to use for each individual action like this:

# in controller
def new # any action
  render :layout => 'main'

Railscasts - Free Ruby on Rails Screencasts