1

I am getting the following error in my rails view:

app/views/welcome/index.html.haml:55: syntax error, unexpected tSTRING_BEG, expecting ')' ...ut.attributes({}, nil, :value="#{num}")}>#{_hamlout.adjust_t... ... ^ 

Here is the two lines that cause it (54 and 55 respectively)

=(1..52).each do |num|
      %option{:value="#{num}"} #{num.to_s} weeks

I am bassically just trying to connect "number " with "weeks" with the + string operator. But i am clearly in the wrong on my approach.

Thalatta
  • 4,510
  • 10
  • 48
  • 79

1 Answers1

1

I think you are missing > on second line. Try this:

=(1..52).each do |num|
     %option{:value => "#{num}"}
Dabrorius
  • 1,039
  • 1
  • 8
  • 17