Blank line template Elixir

0

This code displays a message if it exists, but when it does not exist, it displays a white line:

<%= if @comprovante["transacao"]["complemento"] do %>OBSERVACAO: <%= @comprovante["transacao"]["complemento"]%><% else %><% end %>

How do I not display this blank line?

    
asked by anonymous 19.04.2018 / 19:28

1 answer

0

The line in white that is being displayed is the condition of the else and as it has nothing is returning nil, which makes a blank line, to avoid just removing the else or putting a return to it. >

<%= if @comprovante["transacao"]["complemento"] do %> OBSERVACAO: <%= @comprovante["transacao"]["complemento"]%><% end %>
    
11.05.2018 / 17:22