我刚刚找到了液体并观看了Railscasts。这段视频已经很老了,但从观看它,我可以看到液体是我正在寻找的。问题是我不确定它是否适用于流行的所见即所得的编辑宝石。我真的不希望我的用户使用普通输入字段来制作模板。
我不知道wysiwyg编辑器是否必须特别使用液体,或者液体是否基本上可以与任何所见即所得的编辑器宝石一起工作。
是否推荐使用与液体配合良好的所见即所得的编辑宝石,或者如果不存在与液体配合使用的普通编辑宝石?
答案 0 :(得分:1)
是。请阅读此blog。您还可以使用newsly DNS Name Type TTL Data
dvotedfan.com. A 300 130.211.8.93
www.dvotedfan.com. A 300 130.211.8.93
dvotedfan.com. NS 60 ns-cloud-e1.googledomains.com.
ns-cloud-e2.googledomains.com.
ns-cloud-e3.googledomains.com.
ns-cloud-e4.googledomains.com.
使用gem
编辑器管理liquid
模板。我在我的一个应用程序中使用了wysiwyg
。它很容易安装。
答案 1 :(得分:1)
基本上,您需要解析内容并添加自己的数据。编辑器不会自动计算出变量及其值。编辑器将使用标签保存内容,之后您可以使用Liquid
进行解析以下是Liquid
的示例@template = Liquid::Template.parse("hi {{name}}") # Parses and compiles the template
@template.render('name' => 'tobi') # => "hi topi"
https://github.com/Shopify/liquid#how-to-use-liquid
这是一篇关于某人如何使用带有液体的wysiwyg的博客文章
https://customer.io/blog/Email-wysiwyg-editor-inspired-by-jekyll.html
希望有所帮助