I upgraded one of my apps from rails to 2.3.2 from 2.0.2. Start up find. However, once I start running any pages, the page will display but it doesn't seem to render any layout code. None of the standard tag such head, body which are in the layout get render. It seems that somehow layout is turned off. I checked the error log and didn't find any complaint on layout. Has anyone seen this?
It's hard to say for sure based on what you have provided, but a couple things you might check:
Do your layouts have the correct file extensions (.html.erb instead of .rhtml)
Does the layout name match the controller name or if not is the layout name declared inside the controller
I am assuming the layouts are in the correct directory in your application (app/views/layouts)
Best of luck
Have you tried to set the layout explicityly? (For debugging only)
render :layout => "mylayout"
This may help you to find typos. A colleague once had a space after his layout name, "application.html.erb " which we found this way.
Could you post your controller, layout, and view files up? Might just take a second eye to spot a bloober :-)
I believe that somewhere between Rails 2.0 and 2.3 the location of ApplicationController
changed from app/controllers/application.rb
to app/controllers/application_controller.rb
. Is it possible that because of this (or some other reason) your ApplicationController
isn't getting loaded properly? If so, and if you defined layout
in that class, it might not be picking up the default layout.
Look if you have file app/views/layouts/application.html.erb
- it should be your default layout. I'm not sure but I think Rails in some version changed default layout file name and also, somewhere in the past, changed file extension.
Is it affecting all controllers?
If not look app/views/.html.erb which is probably very blank