我可以在支持图像上传器的 Rails 3.1 应用程序中使用什么所见即所得编辑器?
I tried this editor, but received many errors, maybe existing some editor, which I can easy install and update images.
My answer:
Now I use this editor, very easy to install.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我将tinymce与 gem
'tiny_mce'
和Carrierwave< /code> 用于图像上传。
我对tinymce的设置如下:
重要的部分是我的路线中的
image_list_admin_static_images_url
:StaticImagesController中的方法看起来像:
并且在位于模型中的image_list方法中:
这个设置非常适合我,ofc你需要根据您自己的需要定制它。希望这会对您有所帮助。 TinyMCE 是一个非常好的、强大的所见即所得编辑器。
正如评论部分中的
chech
建议的那样,您可以通过以下方式调整此解决方案以与active_admin
一起使用:要在活动管理中使用它,只需替换此解决方案的路由:
匹配“admin/model_name/:id/js_image_list”, :action => “js_image_list”,:控制器=> “管理员/模型名称”
。然后在活动管理模型文件中创建一个名为js_image_list
的操作。 tinyMCE.init 的配置为:external_image_list_url : "js_image_list"
Im using tinymce with the gem
'tiny_mce'
andcarrierwave
for image upload.My setup for tinymce is following:
The important part is
image_list_admin_static_images_url
in my routes i have:Method in StaticImagesController looks like:
And in image_list method located in the model:
This setup works perfectly for me, ofc you need to customize it for your own needs. Hope this will help you. TinyMCE is really nice and powerfull wysiwyg editor.
As
chech
suggested in the comments section, here is how you can adjust this solution for use withactive_admin
:To use it inside active admin simply replace the route for this one:
match "admin/model_name/:id/js_image_list", :action => "js_image_list", :controller => "admin/model_name"
. Then create an action calledjs_image_list
inside the active admin model file. Configuration for tinyMCE.init is:external_image_list_url : "js_image_list"
看来tinymce肯定是受rails 3.1支持的。这是链接
http://rubygems.org/gems/tinymce-rails
您所要做的就是添加根据您的 Gemfile
您可以将以下选项添加到 application.js,具体取决于您是否想使用 jquery
我个人选择了 jquery,所以我将此行添加到与我的控制器/视图对应的 js.coffee 文件中
如果您不想使用 jquery 你可以将此脚本添加到你的视图中
It seems like tinymce is definitely supported by rails 3.1. Here is the link
http://rubygems.org/gems/tinymce-rails
All you have to do is add the following to your Gemfile
You have the following options to add to application.js depending on whether you want to use jquery or not
Personally I chose jquery so I added this line to the js.coffee file corresponding to my controller/view
If you don't want to use jquery you can just add this script to your view
我在使用 tinymce 和 Rails 资产管道时遇到了问题。我还没有找到一种方法来启动tinymce并增加字体大小。默认字体非常小。
如果您使用 twitter bootstrap,一个很棒的选择是:
https://github.com/jhollingworth/bootstrap-wysihtml5< /a>
如果你想要一些与 HTML5 兼容的东西,我会选择:
http://jejacks0n.github.com/mercury/
太棒了!
I had problems with tinymce and Rails asset pipeline. I have not, also, found a way to start tinymce with increased font size. The default font size is very small.
If you are using twitter bootstrap one fantastic option is:
https://github.com/jhollingworth/bootstrap-wysihtml5
If you want something that works with HTML5 I would go with:
http://jejacks0n.github.com/mercury/
Awesome!