application.html.erb
파일과보기 파일이 결합 된 방법에 대해 매우 혼란 스럽습니다.본문 내용을 본문 섹션으로 옮기는 이유는 무엇입니까?
<html>
<head>
<!-- View Specific Stylesheet -->
<link href="/css/ViewSpecific.css" rel="stylesheet" />
</head>
<body>
<!-- View Specific Body -->
</body>
내가 기대하는 이들 두 파일이 결합 할 때,보기 특정 : 내보기 파일에서
<!DOCTYPE html>
<html>
<head>
<!-- Bootstrap Css -->
<link href="/bootstrap-assets/css/bootstrap.css" rel="stylesheet">
<%= yield :head %>
</head>
<body>
<nav>
<!--Long navbar section -->
</nav>
<%= yield %>
</body>
</html>
: 내 application.html.erb
파일 다음 (짧음을 최소화 내용)에이 스타일 시트로드는 <head>
섹션에 표시되고 특정 바디로드는 <body>
섹션에 표시됩니다. 최종 결과는 navbar
(application.html.erb
)이 이미로드 된 후보기 특정 스타일 시트를 실제로 <body>
섹션으로 보냅니다. 이것은 분명히 스타일 시트가로드되기 전에 내 몸의 일부가로드되는 원치 않는 결과를 가져오고, 사용자가 처음 보는 모든 것은 페이지를 모두 끔찍하게 보입니다.