-
Notifications
You must be signed in to change notification settings - Fork 2
Installation and Setup
Andrew vonderLuft edited this page Dec 4, 2024
·
1 revision
- 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.
Add to the Gemfile of your Rails project:
gem 'comfy'
Then from your Rails project's folder run these commands:
bundle install
rails generate comfy: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 comfy_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 comfy_cms_render_page
appears last.