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

时间:2014-01-09 09:23:45

标签: ruby-on-rails gem blogs redcloth

我需要一个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 个答案:

答案 0 :(得分:20)

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

<强>教程

<强>宝石


<强>博客

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

  1. 创建PostCategoryTagCommentImage模型

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

  3. 添加管理区域(可能包含ActiveAdmin || RailsAdmin),但您可能希望使用this tutorial

  4. 创建自己的区域
  5. 我会使用WYSIWYG(例如Redactor)来创建管理区域中的帖子。看看Petekun的帖子,我建议采用降价格式结构(保持一切干燥)

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

  7. 可以使用PaperclipCarrierwave

  8. 上传图片

答案 1 :(得分:2)

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

如果你只想要一个插入式但相对较重的解决方案,请查看:

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

答案 2 :(得分:1)

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

答案 3 :(得分:0)

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