Layouts in Rails 3.0

I have an admin section in my rails 3 app. where I want to use a
different layout than the main layouts/application.html.haml layout.
Here is the snippet of the admin_controller.rb:

class AdminController < ApplicationController

current_section :admin
layout :admin

Here are the contents of the layouts/admin.html.haml file:

  • content_for :secondary_nav do

    = navigation :second_level_admin

= render :file => “layouts/application”

Rails 3 is ignoring the admin layout all-together. Rails 2.3.8 doesn’t.
Is there an existing bug in Rails 3?


I think it should be layout “admin” . For some reason symbols in the
layout doesn’t work.

Hello Johndel,
Thanks for your response. Unfortunately, it did not work. I typed in

layout “admin”

instead of

layout :admin

Still. No luck.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs