Rails does not load application.html.erb, instead loads view pieces

My application.html.erb is a classic file with the operator <% = yield%>. It is expected that if I go to domain.com/controller/action, this will result in a view in the corresponding directory. Instead, it only tightens the view (the correct view, but without the application shell). (There are no other layouts except the application)

This is my second rails app. The other went smoothly, but this question gives me one problem after another. I rtfm'd and googled and came up with nothing. I even reloaded webrick, although I did not restart apache (proxypass to webrick), as I thought it was overkill. Not to mention the fact that we have sites with a small volume.

The strangest thing is, when I call root ie: domain.com, it calls application.html.erb and displays it at home.

I used scaffolding, but I realized that calling script / generate scaffold just creates files and doesn't configure anything but routes. What I have already fixed.

Things that I thought might help answer the question. Let me know if you need more.

Devel logs, where it is obvious that the layout application is not loading:

domain.com

Processing HomeController#index (for 24.20.194.187 at 2009-09-03 15:24:15) [GET]
  Parameters: {"action"=>"index", "controller"=>"home"}
  ESC[4;35;1mCompany Columns (2.6ms)ESC[0m   ESC[0mSHOW FIELDS FROM `companies`ESC[0m
  ESC[4;36;1mCompany Load (0.4ms)ESC[0m   ESC[0;1mSELECT * FROM `companies` WHERE (`companies`.`subdomain` = 'slate') LIMIT 1ESC[0m
Rendering template within layouts/application
Rendering home/index
  ESC[4;35;1mUser Columns (2.6ms)ESC[0m   ESC[0mSHOW FIELDS FROM `users`ESC[0m
  ESC[4;36;1mUser Load (0.4ms)ESC[0m   ESC[0;1mSELECT * FROM `users` WHERE (`users`.`id` = '2') LIMIT 1ESC[0m

domain.com/users

Processing UsersController#index (for 24.20.194.187 at 2009-09-03 15:24:03) [GET]
  Parameters: {"action"=>"index", "controller"=>"users"}
  ESC[4;36;1mCompany Columns (2.6ms)ESC[0m   ESC[0;1mSHOW FIELDS FROM `companies`ESC[0m
  ESC[4;35;1mCompany Load (0.4ms)ESC[0m   ESC[0mSELECT * FROM `companies` WHERE (`companies`.`subdomain` = 'slate') LIMIT 1ESC[0m
  ESC[4;36;1mUser Columns (2.7ms)ESC[0m   ESC[0;1mSHOW FIELDS FROM `users`ESC[0m
  ESC[4;35;1mUser Load (0.4ms)ESC[0m   ESC[0mSELECT * FROM `users` ESC[0m
Rendering users/index
  ESC[4;36;1mSQL (0.2ms)ESC[0m   ESC[0;1mSET NAMES 'utf8'ESC[0m
  ESC[4;35;1mSQL (0.2ms)ESC[0m   ESC[0mSET SQL_AUTO_IS_NULL=0ESC[0m

application.html.erb [edited content of an element]:

Oh right. less than more. suffice it to say that it has html, head and body tags, with the operator <% = yield%>.

+3
source share
1 answer

, / application.html.erb, UserController , .

+4

Source: https://habr.com/ru/post/1716853/


All Articles