Prefer Simplicity.
____ __ __ _ ____
___ ___ / ___|__ _| \/ ( ) ___|
/ _ \ / __| | / _` | |\/| |/\___ \
| (_) | (__| |__| (_| | | | | ___) |
\___/ \___|\____\__,_|_| |_| |____/
ocCaM'S is a revival of ComfortableMexicanSofa, with all due thanks and acknowledgements to Oleg Khabarov, and others. 'Comfy' is in my experience the simplest and cleanest of all Rails-based CMSes. Seeing that its last commit was in 2020, I was determined that it should not die on the vine as RadiantCMS did some years ago.
ocCaM'S, pronounced "AH-kums" is a nod to Occam's Razor - for this Rails-based Content Management System endeavors to follow the principle that unnecessarily complex models should not be preferred over simpler ones.
- Simple drop-in integration with Rails 6.1+ apps with minimal configuration
- The CMS keeps clear from the rest of your application
- Powerful page templating capability using Content Tags
- Multiple Sites from a single installation
- Multi-Language Support (i18n) (ca, cs, da, de, en, es, fi, fr, gr, hr, it, ja, nb, nl, pl, pt-BR, ru, sv, tr, uk, zh-CN, zh-TW) and page localization.
- CMS Seeds for initial content population
- Revision History to revert changes
- Extendable Admin Area built with Bootstrap 4 (responsive design). Using CodeMirror for HTML and Markdown highlighing and Redactor as the WYSIWYG editor.
- File attachments are handled by ActiveStorage. Make sure that you can run appropriate migrations by running:
rails active_storage:install
and thenrake db:migrate
- Image resizing is done with ImageMagick, so make sure it's installed
- Test suite on Ruby >= 3.0 with Rails >= 6.1
- On Ruby 3.x, Rails 7.x + is recommended, since performance is noticably better than on 6.x
Add gem definition to your Gemfile:
gem "occams"
- From the Rails project's root run:
bundle install
- Then add the CMS:
rails generate occams:cms
- If you want to store files in your CMS with Active Storage:
rails active_storage:install
- Set up the database:
rails db:migrate
Now take a look inside your config/routes.rb
file. You'll see where routes attach for the admin area and content serving. Make sure that content serving route appears as a very last item or it will make all other routes to be inaccessible.
occams_route :cms_admin, path: "/admin"
occams_route :cms, path: "/"
After finishing installation you should be able to navigate to http://localhost:3000/admin
Default username and password is 'user' and 'pass'. You probably want to change it right away. Admin credentials (among other things) can be found and changed in the cms initializer: /config/initializers/occams.rb
Before creating pages and populating them with content we need to create a Site. Site defines a hostname, content path and its language.
After creating a Site, you need to make a Layout. Layout is the template of your pages; it defines some reusable content (like header and footer, for example) and places where the content goes. A very simple layout can look like this:
<html>
<body>
<h1>{{ cms:text title }}</h1>
{{ cms:wysiwyg content }}
</body>
</html>
Once you have a layout, you may start creating pages and populating content. It's that easy.
For more information on how to use this CMS please refer to the Wiki. Section that might be of interest is the entry on Content Tags.
The Occams repository can run like any Rails application in development. It's as easy to work on as any other Rails app. For more detail see CONTRIBUTING
bin/rails db:migrate RAILS_ENV=test
rake db:test:prepare
rake test
- Obviously to Oleg Khabarov, the creator of ComfortableMexicanSofa. This is his work, with a few updates and additions.
- Thanks to Roman Almeida for contributing OEM License for Redactor Text Editor
- Occams Copyright 2023-2024 Andrew vonderLuft, following Comfy, released under the MIT license
- ComfortableMexicanSofa Copyright 2010-2019 Oleg Khabarov. Released under the MIT license