views:

32

answers:

1

I use inplacericheditor plugin and tiny_mce

Before asset_packager usage, this is how I include the files and they work well

<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>

My asset_packager.yml section looks like this for the above files:

  • 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/themes/advanced/editor_template
    • tiny_mce/themes/advanced/langs/en
    • tiny_mce/plugins/save/editor_plugin
    • tiny_mce/plugins/autoresize/editor_plugin
    • tiny_mce/plugins/paste/editor_plugin
    • tiny_mce/plugins/preview/editor_plugin
    • tiny_mce/plugins/table/editor_plugin
    • tiny_mce/plugins/contextmenu/editor_plugin
    • tiny_mce/plugins/emotions/editor_plugin
    • inplacericheditor

When I include the asset_packaged file and load the page (in production) I get the following errors:

"Ajax.InPlaceEditor is undefined" "Ajax.InPlaceRichEditor is not a constructor"

Can anyone shed some light on where I am going wrong or share a better way to asset_package tinymce?

Thanks!

+1  A: 

Ajax required prototype.js

try Following just after tiny_mce_init.js

<%= javascript_include_tag :defaults %>
<script src="/javascripts/inplacericheditor.js" type="text/javascript"></script>
Salil
this doesn't help as I already had included 'defaults' at the top
yes but it is possible sometimes the two javascripts get conflict and so they don't workout together.So i just recommended that you should put that below the "tiny_mce_init.js". Hope that helps :)
Salil