haml / haml-rails

let your Gemfile do the talking
MIT License
1.04k stars 169 forks source link

Excess spaces while rendering multiline string #109

Closed atomAltera closed 8 years ago

atomAltera commented 8 years ago

Hello, today I end up with strange issue in Rails 5:

Here is how a simple text.html.erb file looks like: <textarea><%= "a\nb\nc" %></textarea> And here is what it produce: enter image description here enter image description here

I'm talking about these leading spaces before second and third strings.

In my code I have a form with textarea:

.form
  =form_for article do |f|
    .form-group
      =field_label f, :text, true
      =f.text_area :text, class: %w(form-control), rows: 20, placeholder: t('placeholder.article_text')

And the same issue happens there on Edit action

I found out that the reason is haml-rails gem in Gemfile. Without it <textarea><%= "a\nb\nc" %></textarea> forks fine, but with it, it adds extra spaces.

indirect commented 8 years ago

I strongly suspect that it's the Haml gem, and not this gem, which just contains some generators and has a dependency on Haml.

atomAltera commented 8 years ago

Ok, thank you. Fortunatly, in production it works fine