In haml, how do I make the following incredibly simple HTML:
<p>Results found for <strong>search term</strong>
where is the “search term” really a Ruby variable called @query ?
I am trying to do the following:
%p results found for <strong>= @query</strong>
But that means = @query literally. If I try:
%p results found for <strong> = @query </strong>
then the term of the request is displayed correctly, but is in a new line.
Also, I am wondering if there is a better way to render <strong> in haml, keeping everything in one line.
I know haml documentation , but as far as I can see, there is no example of using a simple built-in ruby variable.
----- UPDATE -------
The following code works and shows how to use a variable that is not in the tags:
%p = @trials_found_count results found for %strong= @query
But I find it really unreadable - it's hard to say that it only displays one line of HTML without adding a comment above.
Is there a way that I can put all this code on one line? Or is it how the haml works?
AP257 source share