Reputation: 91
I've got a problem with layouts and yield. When I follow the guides, I got extra space before the p tag. When I inspect the code with google chrome I got something like:
"
"
between the body and p tags. I type the same code as on the guide but it is not working, did I miss something?
Code for layout:
<html>
<head>
<title>Title</title>
</head>
<body>
<%= yield %>
</body>
</html>
and code for view:
<p>Hello, Rails!</p>
Upvotes: 2
Views: 1021
Reputation: 91
Ok, I founded the problem. It was the UTF8 encoding. In Notepad++, You have to choose to encode in UTF8 but without 'BOM', if you choose only UTF8, you get that extra character which add space.
Thanks!
Upvotes: 6