= Freeberry Brainberry Content Managment System For more instruction see {Wiki}[http://wiki.github.com/galetahub/freeberry]. == Install === Dependents In your Gemfile: gem 'devise', '1.1.3' gem 'paperclip', '2.3.3' gem 'nokogiri', '1.4.3.1' gem 'declarative_authorization', '0.5.1' gem 'responders', '0.6.2' gem 'inherited_resources', '1.1.2' gem 'haddock', '0.2.2' gem 'will_paginate', '2.3.15' gem "mime-types", '1.16', :require => 'mime/types' gem "ckeditor", :git => 'git://github.com/galetahub/rails-ckeditor.git', :branch => 'rails3' gem "freeberry", :git => "git://github.com/galetahub/freeberry.git" Bundler bundle install --path vendor/bundle Plugins: rails plugin install git://github.com/galetahub/enum_field.git rails plugin install git://github.com/galetahub/awesome_nested_set.git rails plugin install git://github.com/galetahub/salty_slugs.git rails plugin install git://github.com/galetahub/auto_html.git rails plugin install git://github.com/galetahub/attach_file_field.git === Generators Plugin attach_file_field wants generate assets: rails generate attach_file_field Devise (http://github.com/plataformatec/devise) rails generate devise:install Ckeditor (http://github.com/galetahub/rails-ckeditor) rails generate ckeditor:base rails generate ckeditor:migration Freeberry rails generate freeberry:base rails generate freeberry:models === Configuration Create yml files: cp config/application.yml.sample config/application.yml cp config/database.yml.sample config/database.yml Create database and load seed data: rake db:create rake db:migrate rake db:seed In config/application.rb: config.autoload_paths += %W( #{config.root}/app/models/defaults ) == Usage === MysqlUtils * database_exists? * truncate_table * disable_keys * enable_keys * with_keys_disabled === Settingslogic cass SystemSettings < Freeberry::Settingslogic source Rails.root.join("config", "application.yml") end === Security Freeberry by default protected all active record attributes for security with mass assignment. To access protected attributes to be dynamic based on user permissions: # models/article.rb class Article < ActiveRecord::Base attr_accessible :name, :content end # articles_controller.rb def create @article = Article.new @article.accessible = :all if admin? @article.attributes = params[:article] if @article.save flash[:notice] = "Successfully created article." redirect_to @article else render :action => 'new' end end === Generators Manage scaffold: rails generate freeberry:manage_scaffold ModelName rails generate freeberry:manage_scaffold ModelName --parent=ParentModel == Example Example goes here. Copyright (c) 2010 Brainberry, released under the MIT license