Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having to explicitly render :layout => 'application' in controller actions in my Rails 3 app

I am having to explicitly render :layout => 'application' in my controller actions in order to get my new rails 3 app to actually use the application.html.erb layout file.

Any obvious things to look for that I am doing wrong? If I don't call the :layout option it just doesn't render the layout. I get a message like:

Processing by FooController#index as HTML

...when I read the terminal window trace on WEBrick

like image 560
Richard Jordan Avatar asked Nov 29 '22 11:11

Richard Jordan


2 Answers

I know this is resing a dead thread but I recently ran into the same issue. My controller was inheriting from ActionController::Base and not ApplicationController. I had the same issue as you were having, until I fixed that.

like image 160
danhere Avatar answered Dec 05 '22 00:12

danhere


I ran into the same issue, the problem ended up being that someone had defined an initialize method for the controller.

like image 26
sfaxon Avatar answered Dec 05 '22 02:12

sfaxon