Pregunta

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.

¿Fue útil?

Solución

Another approach, tested, should work:

= "=" * 10

Otros consejos

This should work

- 10.times do
  &= "="
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top