ComfortableMexicanSofa is a powerful Rails 4 CMS Engine
- Simple integration with Rails 4 apps
- Build your application in Rails, not in CMS
- Powerful page templating capability using Tags
- Multiple Sites from a single installation
- Multi-Language Support (i18n) (cs, da, de, en, es, fr, it, ja, nb, nl, pl, pt-BR, ru, sv, uk, zh-CN, zh-TW)
- Fixtures for initial content population
- Revision History
- Great extendable admin interface built with Bootstrap, CodeMirror and Redactor
Add gem definition to your Gemfile:
gem 'comfortable_mexican_sofa', '~> 1.12.0'
Then from the Rails project's root run:
bundle install
rails generate comfy:cms
rake 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.
comfy_route :cms_admin, :path => '/admin'
comfy_route :cms, :path => '/', :sitemap => false
If you get an Invalid route name
error, look inside your route file to see if there's already the CMS route being duplicated.
Add to application_controller.rb
alias_method :current_user, :current_comfy_user
layout :layout_by_resource
protected
def layout_by_resource
if devise_controller?
"comfy/backend"
else
"application"
end
end
Within the comfortable_mexican_sofa.rb
, add:
config.settings = %w( site_title )
If you want to add custom templates, add an item to the routes file for that template like:
controller :templates do
get 'about', :action => 'about'
end
Then add app/views/templates/about.slim