Hi
Have this helper method inside a sites_helper.rb module
def distritos [ [‘0’, ‘Todos’], [‘1’, ‘Aveiro’], [‘2’, ‘Beja’], [‘3’, ‘Braga’], [‘4’, ‘Brangança’],
['5', 'Castelo Branco'],
['6', 'Coimbra'],
['7', 'Évora'],
['8', 'Faro'],
['9', 'Guarda'],
['10', 'Leiria'],
['11', 'Lisboa'],
['12', 'Portalegre'],
['13', 'Porto'],
['14', 'Santarém'],
['15', 'Setúbal'],
['16', 'Viana do Castelo'],
['17', 'Vila Real'],
['18', 'Viseu']
]
end
this is used to polulate some lists on a view, but i get the following errors. It works fine with rails 1.1.2
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:9: parse error, unexpected tINTEGER, expecting ‘]’ [‘5’, ‘Castelo Branco’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:9: parse error, unexpected tCONSTANT, expecting kEND
['5', 'Castelo Branco'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:10: parse error, unexpected tINTEGER, expecting kEND [‘6’, ‘Coimbra’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:10: parse error, unexpected tCONSTANT, expecting kEND
['6', 'Coimbra'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:11: parse error, unexpected tINTEGER, expecting kEND [‘7’, ‘�vora’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:11: parse error, unexpected tIDENTIFIER, expecting kEND
['7', '�vora'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:12: parse error, unexpected tINTEGER, expecting kEND [‘8’, ‘Faro’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:12: parse error, unexpected tCONSTANT, expecting kEND
['8', 'Faro'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:13: parse error, unexpected tINTEGER, expecting kEND [‘9’, ‘Guarda’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:13: parse error, unexpected tCONSTANT, expecting kEND
['9', 'Guarda'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:14: parse error, unexpected tINTEGER, expecting kEND [‘10’, ‘Leiria’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:14: parse error, unexpected tCONSTANT, expecting kEND
['10', 'Leiria'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:15: parse error, unexpected tINTEGER, expecting kEND [‘11’, ‘Lisboa’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:15: parse error, unexpected tCONSTANT, expecting kEND
['11', 'Lisboa'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:16: parse error, unexpected tINTEGER, expecting kEND [‘12’, ‘Portalegre’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:16: parse error, unexpected tCONSTANT, expecting kEND
['12', 'Portalegre'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:17: parse error, unexpected tINTEGER, expecting kEND [‘13’, ‘Porto’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:17: parse error, unexpected tCONSTANT, expecting kEND
['13', 'Porto'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:18: parse error, unexpected tINTEGER, expecting kEND [‘14’, ‘Santar�m’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:18: parse error, unexpected tCONSTANT, expecting kEND
['14', 'Santar�m'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:20: parse error, unexpected tINTEGER, expecting ‘]’ [‘16’, ‘Viana do Castelo’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:20: parse error, unexpected tCONSTANT, expecting kEND
['16', 'Viana do Castelo'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:21: parse error, unexpected tINTEGER, expecting kEND [‘17’, ‘Vila Real’], ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:21: parse error, unexpected tCONSTANT, expecting kEND
['17', 'Vila Real'],
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:22: parse error, unexpected tINTEGER, expecting kEND [‘18’, ‘Viseu’] ^ /var/rails/LocaisVoo/app/helpers/sites_helper.rb:22: parse error, unexpected tCONSTANT, expecting kEND
['18', 'Viseu']
^
/var/rails/LocaisVoo/app/helpers/sites_helper.rb:22: unterminated string meets end of file /var/rails/LocaisVoo/app/helpers/sites_helper.rb:22: parse error, unexpected $, expecting kEND
If I remove the characters with accents it works as expected.
Thanks in advance for any hint