daryl
daryl

Reputation: 15197

Prevent blank line in HAML

Using .erb, you can do this:

<%= some_func -%>

I was wondering if there's a similar technique using .haml.

= some_func

Upvotes: 2

Views: 329

Answers (1)

Eureka
Eureka

Reputation: 6145

One solution is to explicitly remove the additional newline character using chomp:

= some_func.chomp

Another feature which may accomplish the task is the space removal syntax:

%div<
= "test          "

It returns the following html:

<div>test</div>

Upvotes: 4

Related Questions