Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Adds basic social networking capabilities to your existing application, including users, blogs, photos, clippings, favorites, and more.
Ruby
Tag: v0.10.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
assets
db/migrate
engine_config
engine_plugins
lib
sample_files
tasks
test
.gitignore
LICENSE
README
Rakefile
about.yml
init.rb
install.rb
routes.rb
uninstall.rb

README

COMMUNITY ENGINE
================
Information at: www.missingmethod.com/community_engine

Requirements:
  - RAILS VERSION 2.0.2 
  - The engines plugin for Rails 2.0: http://svn.rails-engines.org/engines/branches/rb_2.0/
  - ImageMagick 
  - Several gems:
    rmagick
    hpricot
    mime-types    
    htmlentities
    redcloth
    rake 0.8.1

GETTING COMMUNITY ENGINE RUNNING
==================================================================
1. From the command line:
    $ rails site_name (create a rails app if you don't have one already)
2. Install the engines plugin:
    $ svn export http://svn.rails-engines.org/engines/branches/rb_2.0/ vendor/plugins/engines
3. Put community engine plugin into plugins directory (use one of the following methods):

    # If you're not using git, and just want to add the source files:
    # Download a tarball from https://github.com/bborn/communityengine/tarball/master 
    # and unpack it into /vendor/plugins/community_engine

    # Using git, make a shallow clone of the community_engine repository:
    $ git clone --depth 1 git@github.com:bborn/communityengine.git vendor/plugins/community_engine

    # If you want to keep your community_engine plugin up to date using git, you'll have to add it as a submodule: 
    # http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#submodules

4. Create your MySQL database (SQLite isn't supported) and modify your config/database.yml appropriately.
5. Delete public/index.html (if you haven't already)
6. Modify your environment.rb as indicated below:

      ## environment.rb should look something like this:
      ===============================================================
      RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
      require File.join(File.dirname(__FILE__), 'boot')
      require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')

      Rails::Initializer.run do |config|
        #resource_hacks required here to ensure routes like /:login_slug work
        config.plugins = [:engines, :community_engine, :white_list, :all]
        config.plugin_paths += ["#{RAILS_ROOT}/vendor/plugins/community_engine/engine_plugins"]
  
        ... Your stuff here ...
      end
      # Include your application configuration below
      require "#{RAILS_ROOT}/vendor/plugins/community_engine/engine_config/boot.rb"

7. Modify each environment file (development.rb, test.rb, and production.rb) as indicated below:

      # development.rb, production.rb, and test.rb should include something like:
      ===============================================================
      APP_URL = "http://localhost:3000" (or whatever your URL will be for that particular environment)

8. Modify your routes.rb as indicated below:

      # Add this after any of your own existing routes, but before the default rails routes: 
      ===============================================================
      map.from_plugin :community_engine
      # Install the default routes as the lowest priority.
      map.connect ':controller/:action/:id'
      map.connect ':controller/:action/:id.:format'
      

9. Generate the community engine migrations: 
    $ script/generate plugin_migration
    
10. From the command line:
    $ rake db:migrate
    # NOTE! You must use a MySQL db, CommunityEngine is not compatible with Rail's default SQLite
11. You may need to change these lines in application.rb (uncomment the :secret part, because you're not using cookie sessions):
    # See ActionController::RequestForgeryProtection for details
    # Uncomment the :secret if you're not using the cookie session store
    protect_from_forgery # :secret => 'your_secret_string'
    
12. Run tests (remember, you must run "rake test" before you can run the community_engine tests): 
    $ rake test
    $ rake community_engine:test
13. Start your server and check out your site! 
    $ mongrel_rails start
    or
    $ ./script/server



## OPTIONAL CONFIGURATION ##
To override the default configuration, create an application.yml file in RAILS_ROOT/config 
===============================================================
The application configuration defined in this file overrides the one defined in /community_engine/engine_config/application.yml
This is where you can change commonly used configuration variables, like AppConfig.community_name, etc.
This YAML file will get converted into an OpenStruct, giving you things like AppConfig.community_name, AppConfig.support_email, etc.



## PHOTO UPLOADING  ##
By default CommunityEngine uses the filesystem to store photos.
To use Amazon S3 as the backend for your file uploads, you'll need the aws-s3 gem installed, and you'll need to add a file called amazon_s3.yml to the application's root config directory (examples are in /community_engine/sample_files). 
You'll need to change your configuration in your application.yml to tell CommunityEngine to use s3 as the photo backend.
Finally, you'll need an S3 account for S3 photo uploading.


## Create an s3.yml file in RAILS_ROOT/config (OPTIONAL) ##
===============================================================
CommunityEngine includes the s3.rake tasks for backing up your site to S3. If you plan on using these, you'll need to add a file in RAILS_ROOT/config/s3.yml. (Sample in sample_files/s3.yml)


## Other notes ##
===============================================================
To customize your application, just create views to override those in community_engine/app/views. 
For example, you could create RAILS_ROOT/app/views/layouts/application.html.haml and have that include your own stylesheets, etc.

You can also override CommunityEngine's controllers by creating identically-named controllers in your applications app/controllers directory.


# Gotchas
1. I get errors running rake! Error: (wrong number of arguments (3 for 1)
  - make sure you have the latest version of rake


# Todo
Latest version of Engines plugin doesn't work (unless you're on EdgeRails)

Something went wrong with that request. Please try again.