Skip to content

Installation and Setup

Andrew vonderLuft edited this page Aug 12, 2023 · 4 revisions

Dependencies

  • Rails 6.1 - 7.0+
  • File attachments are handled by ActiveStorage. You will need to copy over database migrations by running rails active_storage:install
  • To resize attached images you'll need to have ImageMagic installed, or libvps (very fast) on Rails 7+.
  • Pagination is handled by either Kaminari or WillPaginate. Make sure you have one defined in your Gemfile.

Installation

Add to the Gemfile of your Rails project:

gem 'occams'

Then from your Rails project's folder run these commands:

bundle install
rails generate occams:cms
rake db:migrate

The generator will create the initializer, database migration, example CMS Seeds and will move route sets.

Take a look at routes.rb and make sure that the content serving route appears last:

comfy_route :cms_admin, path: '/admin'
comfy_route :cms, path: "/"

Note: All routes appearing after occams_route :cms will not be accessible as it's a globbing route. This includes routes included by other Rails Engines. Make sure that everything looks ok by running rails routes and confirming that occams_cms_render_page appears last.