具有回形针集成功能的 Rails 所见即所得编辑器

发布于 2024-08-21 22:54:38 字数 576 浏览 4 评论 0原文

我正在寻找一种将所见即所得编辑器集成到我的 Rails 应用程序中的方法,以便它将使用 Paperclip 进行图像/文件上传。

我想要的是这样的:用户可以使用所见即所得字段来创建一些富文本。他们可以将图像上传到此文本中,但图像将很好地存储在数据库中(希望使用回形针之类的东西),而不是仅仅转储到服务器上的文件夹中。

这可以做到吗?我花了很长时间在网上寻找解决这个问题的方法。我最接近的是一个看起来非常方便的插件: http://github.com/galetahub/rails -ckeditor

然而,说明有点模糊,我在实现过程中陷入了困境。

我不在乎我使用什么所见即所得编辑器,我的要求非常简单。我也没有完全确定 Paperclip,所以如果有其他方法(使用attachment_fu)我也很乐意考虑。

编辑: 如果我可以将所见即所得编辑器与 Paperclip 集成并将图像存储在文件系统中,我也会很高兴。它不必上传到数据库。现在还有人接盘吗?

I'm looking for a way of integrating a WYSIWYG editor into my rails app so it will use Paperclip for Image / File uploads.

What I want is this: User can use a WYSIWYG field to create some rich text. They can upload an image into this text but the image will be stored nicely in a DB (hopefully using something like Paperclip) instead of just being dumped in a folder on the server.

Can this be done? I've spent a fair while trawling the net for solutions to this problem. The closest I've come is a very handy looking plugin: http://github.com/galetahub/rails-ckeditor

However, the instructions are a bit vague and I got bogged down partway through the implementation.

I don't care what WYSIWYG editor I use, my requirements are very simple. I'm also not totally set on Paperclip so if there's another way (using attachment_fu) I'm happy to consider that too.

Edit:
I'm also happy if I can integrate a WYSIWYG editor with Paperclip and just store the images in the file system. It doesn't have to be uploaded to the DB. Any takers now?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

江南烟雨〆相思醉 2024-08-28 22:54:38

这个问题在这里得到了解答:

Rails 应用程序中的所见即所得图像上传

谢谢@抹茶

This question was answered here:

WYSIWYG image uploads in Rails App

Thanks @Matchu

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文