ERB Template removing the trailing line
问题 I have an ERB template for sending an email. Name: <%= @user.name %> <% if @user.phone.present? %> Phone: <%= @user.phone %> <% end %> Address: <%= @user.address %> I am trying to remove the blank line between Name and Address when Phone is empty. Returned result Name: John Miller Address: X124 Dummy Lane, Dummy City, CA Expected result Name: John Miller Address: X124 Dummy Lane, Dummy City, CA I have tried to use <%--%> tags(to remove the trailing new line) without any success. Name: <%=