这是默认的disqus代码:
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'mysite'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
...
我想根据显示页面的对象的 id 添加一个 disqus_identifier。我尝试了以下两种解决方案,但没有成功。
var disqus_identifier = "<%=mysite_#{@illustration.id}%>";
var disqus_identifier = "mysite_<%=#{@illustration.id}%>";
您如何将 ruby 值插入到 js 变量中?