Sebastien
Sebastien

Reputation: 61

Rails / application.html.erb not loading

I created a ruby application and the application.html.erb is never loaded (looking at webrick output, I never get "Rendered CLASS/index.html.erb within layouts/application", but "Rendered CLASS/index.html.erb")

CLASS.html.erb never gets loaded either.

Only when explicitly specifying "render :file => 'layouts/application'" in the controller, application.html.erb is loaded.

Can anyone help?

Thanks a lot in advance

Sebastien

Upvotes: 6

Views: 3801

Answers (2)

originalhat
originalhat

Reputation: 1716

Ensure that you're controller is inheriting from the ApplicationController.

class YourController < ApplicationController
  ...
end

Upvotes: 14

shingara
shingara

Reputation: 46904

Add in your ApplicationController

layout :application

Now all of your controller use application like default layout.

Upvotes: 0

Related Questions