Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add two variables on one line in HAML?

I'm trying to modify some HAML code and would like to output two different variables on the same line. How can I achieve this?

%h3= @level.name " $" @level.price

Ideally, I want the output to be in this format: Individual $35

Any help would be greatly appreciated.

Thanks!

like image 592
Trey Copeland Avatar asked Sep 13 '25 18:09

Trey Copeland


1 Answers

%h3= "#{@level.name} $#{@level.price}"
like image 126
Kyle Decot Avatar answered Sep 16 '25 08:09

Kyle Decot