문제

So, below is a snippet of code that I have in my application.html.erb file.

<doctype></doctype>
  <html>
    <head>
      <title>Test Title</title>
    </head>
    <body>
      <h1>Hello</h1>
    </body>
  </html>

The Issue: For some reason rails is taking this code and adding it to the body. (see below) When, if i'm not mistaken, it should create the html based off of this code. I've never run into this problem before with rails, and can't seem to find a solution. It's not turbolinks or anything else i've been working with. What could the issue be?

<html>
  <head>
    <style type="text/css"></style>
  </head>
  <body>
    <doctype></doctype>
    <title>Test Title</title>
    <h1>Hello</h1>
  </body>
</html>

P.S. This is not my original code, i've broken it down to the bare minimum to show you what the problem i'm running into is.

도움이 되었습니까?

해결책

the doctype looks off. try:

<!DOCTYPE html>
<html>
  <head>
    head tags
  </head>
  <body>
    body tags
  </body>
</html>

with no closing tag for the doctype

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top