Layouts in Rails 3.0

0 views
Skip to first unread message

Bharat Ruparel

unread,
Aug 25, 2010, 11:22:05 PM8/25/10
to rubyonra...@googlegroups.com
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
.
.
end

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?

Bharat
--
Posted via http://www.ruby-forum.com/.

Yiannis

unread,
Aug 26, 2010, 3:35:19 AM8/26/10
to Ruby on Rails: Talk
I think it should be layout "admin" . For some reason symbols in the
layout doesn't work.

Bharat Ruparel

unread,
Aug 26, 2010, 4:37:57 PM8/26/10
to rubyonra...@googlegroups.com
Hello Johndel,
Thanks for your response. Unfortunately, it did not work. I typed in

layout "admin"

instead of

layout :admin

Still. No luck.

Reply all
Reply to author
Forward
0 new messages