我正在使用gritter_notices gem将闪光警报替换为咆哮类型的通知。到目前为止,这段代码出现在呈现的HTML中:
<script type="text/javascript">
//<![CDATA[
jQuery.gritter.add({image:'/assets/success.png',title:'Success',text:'Record was successfully saved.'});
//]]>
</script>这是application.html.haml格式的
= gflash
= gritter_flash_messages
= yield
= javascript_include_tag "application"
= include_gritter但什么都没出现。帮忙?!
发布于 2012-08-20 21:19:51
我不知道gritter,但我怀疑你显示的代码是在gritter加载之前运行的。将其与document.loaded事件相关联,以便在加载整个页面时执行。
您可以通过使用浏览器调试工具来捕获此问题。
https://stackoverflow.com/questions/12037615
复制相似问题