开发者

Rails Ruby Gems vs Pure Development When Generating A Rich Blog

开发者 https://www.devze.com 2023-02-11 17:54 出处:网络
Some ruby gems like jekyll, toto and webby offer out of the box blog-type integration into your ruby app. Another way of developing a rich web blog-type application is to build and model the applicati

Some ruby gems like jekyll, toto and webby offer out of the box blog-type integration into your ruby app. Another way of developing a rich web blog-type application is to build and model the application yourself using pure ruby and rails practices. (e.g creating an Article and User model). The first offers out of the box features the 2nd option offers more customization and control.

In people's exp开发者_开发知识库erience on Stack Overflow, which would be the best route and what would people consider when making the decision to use a gem out of the box versus going alone?


All of the gems you mentioned take static, markdown/textile/etc files and turn them into HTML websites. They take different approaches to it, with jekyll spitting out the finished website for hosting, toto doing the converting and routing on request, and webby doing the same as jekyll mostly.

If you're using Rails, it's important to note that none of these will integrate into your application well. They're built to more-or-less operate on their own.

Generally speaking, if a gem has the functionality you need, use it. They are not equivalent to plugins you find for Wordpress and Drupal where they are typically low-quality, buggy, poorly documented, etc. More often than not, gems simply add a couple modules that you can integrate into your application how you like.

On the other hand, a basic blog is pretty quick and simple in Rails, especially considering you've got a handy walkthrough guide straight from the Rails documentation on how to do it.


If you're new to Rails and want tight integration with your app, it's probably best to bake your own blog features.

This will take some time to do, but its worth it to learn how things really work.

If you're more seasoned, just look at the gem's API and documentation and decide if it does what you want it to do and if you're comfortable with how to integrate it. If so, it'll save you time.

One other consideration: who will be using the blog? Is it for internal use, and programmers will be the ones updating it? If that's the case, then you can make it very easy by not worrying about a lot of aesthetic polish in the back-end. Conversely, if you're making an app that includes a blogging component for the general public you might want it to feel more polished. In this case a gem might save you a lot of time.

It depends on your application.

0

精彩评论

暂无评论...
验证码 换一张
取 消