Comfortable Mexican Sofa (CMS) ============================== What is this? ------------- Comfortable Mexican Sofa is a Content Management System with an obnoxious name. Also it's a Rails 3 Engine. This means that you can use it as a stand-alone application and also as an Engine for your existing application. Installation ------------ ### Stand-alone TODO: Need to create some sort of setup, so you can simply run: $ comfortable_mexican_sofa my_new_app ### As a Rails Engine Add gem definition to your Gemfile: config.gem 'comfortable_mexican_sofa' Then from the Rails project's root run: bundle install rails g cms rake db:migrate At this point you should have database structure created, some assets copied to /public directory and initializer set up: ComfortableMexicanSofa.configure do |config| config.cms_title = 'ComfortableMexicanSofa' config.authentication = 'ComfortableMexicanSofa::HttpAuth' end # Credentials for CmsHttpAuthentication ComfortableMexicanSofa::HttpAuth.username = 'username' ComfortableMexicanSofa::HttpAuth.password = 'password' Usage ----- Now you should be able to navigate to http://yoursite/cms-admin ### Step 1: Create Site CMS allows you to run multiple sites from a single installation. Each site is attached to a hostname. For the first time you'll be prompted to set up the initial site. Hostname will be pre-populated so just choose a label. ### Step 2: Create Layout Before creating pages and populating them with content we need to create 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:

My Awesome Site

So there's your layout and the `` defines a place where renderable `content` will go. There's just a handful of tags that you can use. *Page Blocks* are pieces of content that will be output on the page: # same as , will render a text area during page creation # will render a text field during page creation # datetime select widget # a number field *Page Fields* are pieces of content that are not rendered. They are useful for hidden values you want to use inside your app. # text area for the page creation form # same as , this is a text field # datetime # a number field *Snippets* bits of reusable content that can be used in pages and layouts *Partials* are exactly that. You don't want to do IRB inside CMS so there's a handy tag: You don't have to define entire html layout, however. You can simply re-use your application one. Page content will be yielded into it like any normal view. TODO: more stuff ### Step 3: Create Page TODO: You pres butan page is created. Yay!