public
Fork of vigetlabs/sandstone
Description: A resourceful plugin providing lightweight content management functionality to Rails applications
Homepage: http://www.viget.com/extend/sandstone-a-drop-in-cms-for-existing-rails-applications/
Clone URL: git://github.com/bscofield/sandstone.git
ben (author)
Thu Dec 13 05:52:38 -0800 2007
commit  aaa7b7e4781cd7009772de2609677000cc463eed
tree    491c8c448c0c9cacd956569f32fd031e63eb9227
parent  390f0152826649860aa0cf923ae3c0d81c4b1a5d
name age message
file MIT-LICENSE Tue Sep 11 07:29:47 -0700 2007 sandstone - initial commit [ben]
file README Wed Sep 26 10:58:57 -0700 2007 added audits, generate tests [ben]
file Rakefile Tue Sep 11 07:29:47 -0700 2007 sandstone - initial commit [ben]
directory generators/ Thu Dec 13 05:52:38 -0800 2007 add summary for pages [ben]
file init.rb Tue Sep 11 07:29:47 -0700 2007 sandstone - initial commit [ben]
file install.rb Tue Sep 11 07:29:47 -0700 2007 sandstone - initial commit [ben]
directory lib/ Wed Sep 26 10:58:57 -0700 2007 added audits, generate tests [ben]
directory tasks/ Wed Sep 26 10:58:57 -0700 2007 added audits, generate tests [ben]
file uninstall.rb Tue Sep 11 07:29:47 -0700 2007 sandstone - initial commit [ben]
README
Sandstone
=========

Introduction goes here.


Dependencies
============
You must be running acts_as_versioned and acts_as_tree to use Sandstone.

You do not need to use the RESTful Authentication plugin to use Sandstone, but it will help. At a mininum, you must 
define the methods +logged_in?+, +current_user+, and +access_denied+ in +ApplicationController+. 

+current_user+ must return an object that can match up with Sandstone's +editor+ object. +access_denied+ should handle 
redirection and messaging when a non-editor tried to visit an administrative page.


Models
======
Sandstone uses polymorphism to link editors with your user model. To activate the link, you'll have to add the following 
line to your user (account, member, etc.) model:

  has_one :editor, :dependent => :destroy, :as => :user

Whatever user model you use, it should respond to a request for +name+ - that's what the Sandstone admin interface 
displays for its editors. Note that this means you'll have to add a name method or column to your User model if you're 
running RESTful Authentication.

Controllers
===========
Add the following line to your ApplicationController:

  include SandstoneSystem
  
If you want to audit editor logins, you should add +Audit.log('login', editor)+ to the action that logs people in.


Routes
======
You must add the following routes (or similar ones) to your config/routes.rb file. Note that +map.sandstone '*path'+ is 
a catch-all route, so if you're relying on the standard Rails default route (+':controller/:action/:id'+) you may have 
to do some more work to get Sandstone running.

  map.workspace 'editor/home', :controller => 'editors', :action => 'show'
  map.resources :audits
  map.resources :editors
  map.resources :pages
  map.resources :page_templates
  map.resource  :preview
  map.resource  :sitemap
  map.sandstone '*path', :controller => 'pages', :action => 'show'


Example
=======

Example goes here.


Copyright (c) 2007 Ben Scofield, released under the MIT license