实际上我确实存在维持宝石的问题。在等待来自TL的gon的答案时,我需要设置我的东西,所以我尝试了全局变量。在create_comment.jst.skim
中看起来像这样<div class="panel" id="question_comment_#{@comment_id}">
<div class="panel-heading">#{@user_name}</div>
<div class="panel-body">#{@comment_body}</div>
<a class="delete_comment" href="/comments/#{@comment_id}" data-method="delete" rel="nofollow" data-remote="true" data-confirm="Are you sure?">Delete<a>
</div>
<script>
window.commentIdea = "#{@comment_id}"
</script>
当我尝试使用此变量时(del.coffee中的示例)
$ ->
console.log(commentIdea)
nodeId = "comment/" + commentIdea
我收到错误(在控制台中)
SyntaxError: expected expression, got '<'
<window class="commentIdea">173</window>
需要一些帮助