Quick Survey Of Rails CMS


09-27-2013


Filed under: rails, cms, featured

Update 1 (September 29, 2013) - Added references and more CMS.
Update 2 (September 30, 2013) - ComfortableMexicanSofa does not use Liquid Template, as GBH has pointed out in the comment.

Selecting a Content Management System (CMS) is never an easy task. I have recently spent a good amount of time tinkering with different implementations and would like to share my learnings here.

There are many solutions on the market so you should solidify your requirements to help you narrow down the choices. This CMS will be used for ForYogi with the following requirements:

####General Impression

CMS is often used by developers to create customizable mostly static websites for clients. Most of the Rails CMS gems have over the years, enginfied, providing drop-in support for existing Rails apps.

RefineryCMS

There are free and pro episodes of it on RailsCasts.com. I don’t have a pro-account so I only examined the free content. My impression is it’s easy to set it ground-up with customized style. This CMS has been around for a long time and has a good community build around it. There are two factors against me choosing it though:

LocomotivesCMS

This one has a nicely styled site (compare to some other CMS) but has a few things that concerns me:

As there is no guarantee for a rather future release of Rails4 support (at least not in their current roadmap), I pass. AlchemyCMS

I first learned about this CMS through the comments on the free RailsCasts episode. They argued about why they are better than refineryCMS. I liked their idea of storing pure content, not css style and layouts in database. It’ll only make migration to other systems easier. I also noticed that they have a 3.0-dev branch supporting Rails4 with this sha. Installation has proven to be hard as there are a few conflict in various gems (if you use activeadmin and devise). I was able to install it after some struggle. However, I encountered problems running it (devise login, actions_cache). It was just wasting more time than I wanted at this point.

BrowserCMS

The first problem I had is jquery-rails version being too low even for their Rails 4 master branch for which peakpg opened an issue. After fixing that in my own fork, I continue running into other problems. Basically the Rails4 support is not quite ready yet.

ComfortableMexicanSofa

This cleverly named gem is lesser popular than the other gems I’ve looked at based on the number of watches and forks on github. However, it is the only one that worked out-of-box with an existing Rails4 app with devise authentication. The documentation explains the theory well but lacks examples. I suggest watching the RailsCasts free episode on Liquid template and really understand tags and how to apply partials/helpers.

Here is how to create a simple navigation for all the pages. According to the guide, you need to add something like this:

<% @cms_site.pages.root.children.published.each do |page| %>
  <%= link_to(page.label, page.url) %><br>
<% end %>

But where do you add it? I tried to create a new partial _kb.html.erb under app/views/layouts and got a no partial found error. It is looking for cms_content and application directories for partials. So I created app/views/cms_content directory and moved the partial there. This kind/level of details should, ideally, be in the guide. You can then invoke this partial inside of a layout:

{{ cms:partial:kb }}

Once you get how Liquid template markup works with comfy sofa, it becomes intuitive to create sites/layouts/pages.

CMS_Admin

It is based on active_admin and uses devise for authentication. It is Rails4 only but it is an app and not meant to be used with any existing Rails application.

###Conclusion

I selected ComfortableMexicanSofa for its ease in integration into an existing Rails4 application with devise authentication. The customization seems to be quite flexible. It is also possible to invoke it from the main app which enables me to display help content in various places inside of the app. The only requirement I haven’t looked at is search.

References

A list of Rails CMS