如何在Rails3.1应用程序中将照片上传与tinymce内容编辑器集成?
我正在使用tinymce-rails gem,它本身就工作得很好。我想为其创建一个自定义插件,以便我可以使用回形针将图像上传到媒体库。我需要访问 tinymce 目录,以便添加自定义插件代码,我只是不知道 gem 将其放在哪里。我不完全确定资产管道从哪里加载文件(例如 jquery 在哪里?)。我知道它连接了 app/assets/javascripts 目录中的文件,但该目录只包含 application.js 文件。任何人都知道这个问题的解决方案。也许我什至不需要创建自定义插件。
I am using the tinymce-rails gem which is working great on it's own. I want to create a custom plugin for it so I can use paperclip to upload images to a media library. I need to access the tinymce directory so I can add my custom plugin code, I just don't know where the gem is putting it. I am not completely sure where the asset pipeline loads files from(where does jquery live? for example). I know that it concatenates the files from the app/assets/javascripts directory, but that directory only contains the application.js file. Anyone know of a solution for this. Maybe I don't even need to create a custom plugin.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
插件(自定义和常规插件)通常可以在
tiny_mce/plugins/pluginname/editor.js
下找到。我不熟悉tinymce-rail gem,但是您可以搜索“contextmenu”(一个常规插件),如果该目录与常规发布的tinymce版本中的目录不同,您将找到包含其他插件的目录。Plugins (custom and regular ones) are usually to be found under
tiny_mce/plugins/pluginname/editor.js
. I am not familiar with tinymce-rail gem, but you could for example search for "contextmenu" (a regular plugin) and you will find the directory containing the others if the directory is another than the one in the regular shipped tinymce version.