Rails rendering inserts white space

I am new to rails and I have a strange problem when I try to do partial. Instead of just displaying HTML, it adds white space surrounded by quotation marks over partial content.

View (index.html.erb)

<div>
  <%= render 'shared/rightColumn' %>
</div>

Partial (_rightColumn.html.erb)

<div>
    Some Content...
</div>

Result...

<div>
  ""
  <div>
    Some Content...
  </div>
</div>

This causes the contents of my partial object to shift down in the view, because the browser takes that empty space into account. If I add one comment before invoking the rendering and another at the beginning of the partial content, blank space is added between the two comments.

, . Rails , , . , . ? ?

.

+4
1

, CSS reset.

* {
    margin: 0;
    padding: 0;
}
0

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


All Articles