Frage

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.

War es hilfreich?

Lösung

the doctype looks off. try:

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

with no closing tag for the doctype

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top