2012-02-17 2 views
0
$('#<%= dom_id(@response[:domain]) > div.queries > #<%= dom_id(@response[:tag]) %>').fadeOut -> 
    $(this).remove() 

Это производит следующее сообщение об ошибке в логах:Что не так с этим простым coffeescript?

ActionView::Template::Error (compile error 
app/views/domains/untag.js.coffee:2: syntax error, unexpected $undefined 
    $(this).remove() 
^
app/views/domains/untag.js.coffee:3: unterminated string meets end of file 
app/views/domains/untag.js.coffee:3: syntax error, unexpected $end, expecting kEND): 
    1: $('#<%= dom_id(@response[:domain]) > div.queries > #<%= dom_id(@response[:tag]) %>').fadeOut -> 
    2: $(this).remove() 
    app/views/domains/untag.js.coffee:3:in `compile' 
    app/controllers/domains_controller.rb:45:in `untag' 
+1

Недостаточно сахара. – AMissico

ответ

3

Проблема (по крайней мере, один из них) находится в строке

'#<%= dom_id(@response[:domain]) > div.queries > #<%= dom_id(@response[:tag]) %>' 

Вы открываете два <%= блоки, но близко к этому единственный.

+0

Спасибо sergio Кажется, все мои проблемы были связаны с синтаксическими ошибками, подобными этому – Arosboro