11

我需要一个 gem 来在我的 rails 应用程序中创建博客。我们可以编写一大堆代码,但对于这个小任务,一个有效的 Gem 更可取。请推荐一个好的 Gem 来创建支持以下功能的博客:

- Adding static  Blog contents. 
- Feature to have image in blog
- Visitor/Viewer must be able to comment/share the blog 
 ( will be much nicer if can be commented/shared via Facebook account)

我通过 Gems 喜欢:

-  "Redcloth" (for creating static web pages quickly; quite unsure 
    will it be able to handle image & comment facility. )
-  Gem "dynarex-blog" (for creating blog, but unable to find 
   good tutorial / proper documentation for integrating it with my Application).
4

4 回答 4

21

以下是您可能会受益的更多资源:

教程

宝石


博客

如果我要创建一个简单的博客应用程序,我会这样做:

  1. 创建Post, Category, Tag, Comment,Image模型

  2. 在路由中使用 Slugalicious 以路由到具有以下路由的帖子:domain.com/blog/your-post-title

  3. 添加管理区域(可能使用ActiveAdmin || RailsAdmin ),但您可能希望使用本教程创建自己的

  4. 我会使用所见即所得(例如Redactor)在管理区域中创建帖子。查看 Petekun 的帖子,我建议使用降价格式结构(保持一切干燥)

  5. 使用CanCan确定哪些用户角色可以写评论等

  6. 可以使用PaperclipCarrierwave上传图像

于 2014-01-09T10:39:13.400 回答
3

假设您已经准备好一个应用程序,并希望尽快向其添加一个非常小的“博客”,

如果您只是想要一个简单但相对较重的解决方案,请查看:

(来源:一个干净的最小 gem 来添加一个简单的博客到现有的应用程序?[关闭]

于 2014-01-09T09:41:56.480 回答
1

你需要的是https://github.com/jipiboily/monologue。它是满足您所有要求的一颗宝石。要覆盖源,只需将内容复制到您的 rails 应用程序文件夹即可。因此,您可以使用自己的风格和逻辑。

于 2014-07-23T08:39:04.133 回答
0

你可能喜欢https://github.com/mixandgo/simple_blog。它没有从您的主应用程序命名空间,因此您可以将其作为现有 Rails 应用程序的一部分插入。

于 2014-12-24T13:31:23.220 回答