Tags


Its may require that you dont want to use application.html layout for some pages . For e.g display different header on page2 which than page 1 and the header is rendered in application.html.erb.

One way is to create a new layout for e,g headerless.html.erb inside a views->layout folder and in the particular controller which serves the request set the new layout .


 class SomeController < ApplicationController

    layout :headless , :only=>[:your_action1,:your_action2]

end

With the layout keyword you can use options such as :only, :except.

Advertisements