asset_packing tiny_mce文件

时间:2010-04-16 07:57:24

标签: ruby-on-rails tinymce

我使用inplacericheditor插件和tiny_mce

在使用asset_packager之前,这是我包含文件的方式,它们运行良好

<script src="/javascripts/patch_inplaceeditor_1-8-2.js" type="text/javascript">    
</script>
<script src="/javascripts/patch_inplaceeditor_editonblank_1-8-2.js" type="text/javascript" </script>
<script src="/javascripts/tiny_mce/tiny_mce.js" type="text/javascript"></script>  
<script src="/javascripts/tiny_mce_init.js" type="text/javascript"></script>
<script src="/javascripts/inplacericheditor.js" type="text/javascript"></script>

我的asset_packager.yml部分对于上述文件看起来像这样:

  • tinyeditor:
    • patch_inplaceeditor_1-8-2
    • patch_inplaceeditor_editonblank_1-8-2
    • tiny_mce / tiny_mce
    • tiny_mce_init
    • tiny_mce / LANGS / EN
    • tiny_mce /主题/先进/ editor_template
    • tiny_mce /主题/先进/ LANGS / EN
    • tiny_mce /插件/保存/ editor_plugin
    • tiny_mce /插件/自动调整大小/ editor_plugin
    • tiny_mce /插件/粘贴/ editor_plugin
    • tiny_mce /插件/预览/ editor_plugin
    • tiny_mce /插件/表/ editor_plugin
    • tiny_mce /插件/文本菜单/ editor_plugin
    • tiny_mce /插件/情感/ editor_plugin
    • inplacericheditor

当我包含asset_packaged文件并加载页面时(在生产中) 我收到以下错误:

“Ajax.InPlaceEditor未定义” “Ajax.InPlaceRichEditor不是构造函数”

任何人都可以了解我出错的地方或分享更好的资产包装方法吗?

谢谢!

1 个答案:

答案 0 :(得分:1)

Ajax需要prototype.js

尝试在tiny_mce_init.js之后关注

<%= javascript_include_tag :defaults %>
<script src="/javascripts/inplacericheditor.js" type="text/javascript"></script>