在 Rails 应用程序中创建全功能博客的 Gem

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)

我像这样通过宝石得到了:

-  "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).

https://dev59.com/h23Xa4cB1Zd3GeqPdFDi - Muntasim
可能是为Rails应用程序提供博客引擎的重复问题。 - Robin
4个回答

21

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

教程

Gems


博客

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

  1. 创建PostCategoryTagCommentImage模型

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

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

  • 我会使用所见即所得编辑器(比如Redactor)来创建后台的文章。看了Petekun的帖子后,我建议采用Markdown格式结构(保持DRY原则)。

  • 使用CanCan来确定哪些用户角色可以发表评论等。

  • 可以使用PaperclipCarrierwave来上传图片。


  • 前两个给出的链接无法访问。 - autopoietic
    2
    我认为CanCan已经过时,被CanCanCan所取代。 - Artem

    3
    假设您已经有一个应用程序,并且希望尽快将非常简单的“博客”添加到其中,以下是一些技术建议:

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

    (来源:A clean minimal gem to add a simple blog to existing app? [closed]


    2
    你需要的是https://github.com/jipiboily/monologue。这是一个宝石(gem),提供了你所有的需求。如果要覆盖源代码,只需将内容复制到你的Rails应用程序文件夹中。这样你就可以使用自己的风格和逻辑。

    0
    你可能会喜欢https://github.com/mixandgo/simple_blog。它没有与你的主应用程序进行命名空间区分,因此你可以将其作为现有Rails应用程序的一部分直接插入其中。

    网页内容由stack overflow 提供, 点击上面的
    可以查看英文原文,
    原文链接