简体   繁体   English

向Rails 4应用添加博客

[英]Adding a blog to a rails 4 app

I'm working on building a personal site for myself and want to add a blog. 我正在为自己建立一个个人网站,并希望添加一个博客。 I have followed a couple tutorials but those didn't really provide me with what I was looking for especially in terms of formatting post and adding images. 我遵循了一些教程,但是这些教程并没有真正为我提供所需的内容,尤其是在格式化帖子和添加图像方面。 Many of the similar questions I reviewed on this topic are dated and I was reviewing a number of Gems and they seem to not support rails 4. 我在该主题上审查的许多类似问题都已过时,并且正在审查许多Gems,它们似乎不支持rails 4。

I would greatly appreciate learning from this community the different ways all of you have gone about adding a blog to your apps/projects. 我非常感谢从这个社区中学习到所有人在向应用程序/项目中添加博客的不同方式。 If there is a related resource you can direct me to that would be a bonus. 如果有相关资源,您可以指导我,这将是一项奖金。

Thank you in advance for any help you can provide. 预先感谢您提供的任何帮助。

In terms of formatting a post. 在格式化帖子方面。 What you want is either a CMS or a WYSIWYG. 您想要的是CMS或WYSIWYG。

I recently used tinymce (which has a rails gem compatible with 4 but honestly you can just initialize it yourself with javascript). 我最近使用了tinymce (它具有与4兼容的rails gem,但老实说,您可以使用javascript对其进行初始化)。 You just use a textarea field, say body, and initialize tinymce on it. 您只需要使用textarea字段,例如body,然后在其上初始化tinymce。 Save it like a normal one and you're all set. 像平常一样保存它,一切就绪。 Display it with <%raw @post.body %> <%raw @post.body %>显示它

I don't like CMS 's, they can be useful but it was a pain to use. 我不喜欢CMS ,它们虽然有用,但是使用起来很痛苦。 A year ago I used ActiveAdmin with a plugin (I was already using ActiveAdmin so it made sense) 一年前,我将ActiveAdmin与一个插件一起使用(我已经在使用ActiveAdmin,因此很有意义)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM