How do you make text and variable in haml appear o

2020-03-31 08:53发布

I have this code and I want it to read as Volunteers Needed: 10 (event.numberofvolunteers value) on the same line. How can I do this without using css? I haven't found a specific post addressing this issue.

%td Volunteers Needed:
  = event.numberofvolunteers

2条回答
女痞
2楼-- · 2020-03-31 09:17

Best way to write this would be :

%td Volunteers Needed: #{event.numberofvolunteers}
查看更多
孤傲高冷的网名
3楼-- · 2020-03-31 09:25

Try this:

%td= "Volunteers Needed: #{event.numberofvolunteers}"
查看更多
登录 后发表回答