什么所见即所得与 jQuery 和 Ruby on Rails 3.1 (Sprockets) 配合得很好?
我在使用 Rails 进行任何“常见”所见即所得工作时遇到困难。我们甚至不得不暂时用 RedCloth 自己做一个。
我尝试使用 tinymce-rails 但无法使其工作。还尝试了 nicEdit ,它有效,但仅当您调用在线图书馆时(并且看起来也被遗弃)。
有人使用过对 jQuery 和 Rails 3.1(Sprockets)友好的所见即所得吗?
I am having trouble making any "common" WYSIWYG work with Rails. We even had to do one ourselves with RedCloth for the moment.
I tried to use tinymce-rails but couldn't make it work. Also tried nicEdit which worked but only when you called the online library (and also looks abandoned).
Has anyone worked with a good WYSIWYG that is jQuery and Rails 3.1 (Sprockets) friendly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我在 Rails 3.1 应用程序中使用 ckeditor。
只需将文件夹放入 lib/assets/javascripts 中,每当需要时就可以像这样引用它:
在 javascript 中:
I use ckeditor in my Rails 3.1 app.
Just throw the folder into you lib/assets/javascripts and whenever you need it reference it like this:
And in javascript:
在解决这个问题一段时间后,我想出了一个将标准tinyMCE与Rails 3.1和资产管道结合使用的解决方案。
/vendor/assets/javascripts/tiny_mce
jquery.tinymce.js
放在/vendor/assets/javascripts/tiny_mce内
/public/javascripts
文件夹中名为tiny_mce
的目录内将tinyMCE添加到您的
application.js
中,如下所示:我也在我的
application.js
中初始化tinyMCE,并设置< code>script_url 路径告诉tinyMCE它的支持文件现在位于我的public/javascripts/tiny_mce
目录中:应该可以。现在,您正在使用资产管道加载tinyMCE,并从公共目录提供支持资产和javascript。
After struggling with this issue for quite awhile, I came up with a solution for using the standard tinyMCE with Rails 3.1 and the asset pipeline.
/vendor/assets/javascripts/tiny_mce
jquery.tinymce.js
inside of/vendor/assets/javascripts/tiny_mce
/public/javascripts
folder, inside of a directory calledtiny_mce
Add tinyMCE to your
application.js
like so:I initialize tinyMCE in my
application.js
as well, and set ascript_url
path to tell tinyMCE that it's supporting files now live in mypublic/javascripts/tiny_mce
directory:That should work. Now you are using the asset pipeline to load tinyMCE, and serving the supporting assets and javascripts from the public directory.
Mercury Editor 看起来很有前途。我打算在下一个 Rails 项目中尝试一下。
http://jejacks0n.github.com/mercury/
The Mercury Editor looks promising. I'm planning to try it on my next rails project.
http://jejacks0n.github.com/mercury/
尝试 MarkitUp
http://markitup.jaysalvat.com/home/
Try MarkitUp
http://markitup.jaysalvat.com/home/
Luuf 已经提到了 Aloha-Editor。尽管它仍在大力开发中,但看起来很有希望。
只需将 aloha-config.js 文件放在资产路径中的任何位置,aloha 文件就会转到(即)供应商/资产。
示例配置:
“baseUrl”行是最重要的。将其设置为 /assets/lib 似乎可以确保与资产管道的兼容性。
还没有尝试过串联,当我知道它的行为方式时会发表评论。
问候!
Luuf already mentioned Aloha-Editor. Though it's still under heavy development it looks quite promising.
Just put a aloha-config.js file anywhere in your asset path, the aloha-files goes to (i.e.) vendor/assets.
Example config:
The line "baseUrl" is most important. Setting it to /assets/lib seems to ensure compability with the asset pipeline.
Haven't tried concatenation yet, will post a comment when I know how it behaves.
Regards!
Aloha 编辑器
http://aloha-editor.org/ Mercery - 但 Aloha 有更好的“感觉”,并且有更广泛的浏览器支持。
Aloha Editor
http://aloha-editor.org/
It's tough between that & Mercery - but Aloha has a nicer "feel" and it has wider browser support.