简体   繁体   中英

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

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

class YourController < ApplicationController
  ...
end

Add in your ApplicationController

layout :application

Now all of your controller use application like default layout.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM