Question

In Rails with HAML, I want to create a simple line of spaces: ====== on the page, with variable length. However, the following code:

- 10.times do
  \=

renders the following:

= = = = = = = = = =

I want to get rid of the spaces in the middle of these equals signs, but I don't really have any idea how. I know with ERB you can use

<%= 10.times do -%>=<% end %>

but I'm having trouble figuring out how to do it here.

Was it helpful?

Solution

Another approach, tested, should work:

= "=" * 10

OTHER TIPS

This should work

- 10.times do
  &= "="
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top