Haml renders HTML in two different steps

I have a problem with my application.

Two stages, the same application, the same deployment recipes and, of course, the same gems.

In my staging environment, everything is fine, in my production environment the HTML is slightly different, and this causes me some rendering problem.

Example.

Phased

<a class="btn red" href="/admin/contents/new?type=News" title="News">News
<i class='fa fa-plus'></i>
</a>
<a class="btn blue" href="/admin/contents/new?type=Article" title="Article">Articolo

Products

<a class="btn red" href="/admin/contents/new?type=News" title="News">News
<i class='fa fa-plus'></i>
</a><a class="btn blue" href="/admin/contents/new?type=Article" title="Article">Articolo

The difference is small, but the problem is that in my production environment I lose all the space between the buttons.

The code generating this button is simple:

.col-md-3
  = link_to new_admin_content_path(type: 'News'), class: "btn red", title: "News" do
    News
    %i.fa.fa-plus
  = link_to new_admin_content_path(type: 'Article'), class: "btn blue", title: "Article" do
    Articolo
    %i.fa.fa-plus

What a problem ???

+4
source share
1 answer

Here is an excerpt from the haml FAQ:

Why is my markup properly debugged in development mode, but not in production?

Haml {Haml:: Options # "" ) Rails, .

FAQ. , Haml . , :

# config/initializers/haml.rb
Haml::Template.options[:ugly] = false
Haml::Template.options[:remove_whitespace] = false

.

.

+1

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


All Articles