# 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)

Modify your routes.rb as indicated below:

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

Generate the community engine migrations:

$ script/generate plugin_migration

From the command line:

$ rake db:migrate

You may need to change these lines in application.rb (if 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'

Run tests (remember, you must run rake test before you can run the community_engine tests):

$ rake test
$ rake community_engine:test

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/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

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)

Roles

CommunityEngine Users have a Role (by default, it's admin, moderator, or member)

To set a user as an admin, you must manually change his role_id through the database.
Once logged in as an admin, you'll be able to toggle other users between moderator and member (just go to their profile page and look on the sidebar.)

Customize your theme. For example: you can create a /RAILS_ROOT/theme/your_theme_name/views/shared/_scripts_and_styles.html.haml to override the default one, and pull in your theme's styleshees.

To get at the stylesheets (or images, or javascripts) from your theme, just add /theme/ when referencing the resource, for example:

= stylesheet_link_tag 'theme/screen' # this will reference the screen.css stylesheet within the selected theme's stylesheets directory.

Note: when running in production mode, theme assets (images, js, and stylesheets) are automatically copied to you public directory (avoiding a Rails request on each image load).

Localization

Localization is done via Rails native I18n API. We've added some extensions to String and Symbol to allow backwards compatibility (we used to use Globalite).

Strings and Symbols respond to the .l method that allows for a look up of the symbol (or a symbolized version of the string) into a strings file which is stored in yaml.

For complex strings with substitutions, Symbols respond to the .l method with a hash passed as an argument, for example:

:welcome.l :name => current_user.name

And in your language file you'd have:

welcome: "Welcome {{name}}"

To customize the language, or add a new language create a new yaml file in RAILS_ROOT/lang/ui.
The name of the file should be LANG-LOCALE.yml (e.g. en-US.yml or es-PR)
The language only file (es.yml) will support all locales.

To wrap all localized strings in a <span> that shows their localization key, put this in your environment.rb:

You can also require recaptcha on signup (to prevent automated signups) by adding this in your application.yml (you'll still need to add your ReCaptcha keys):

require_captcha_on_signup: true

Akismet: Unfortunately, bots aren't the only ones submitting spam; humans do it to. Akismet is a great collaborative spam filter from the makers of Wordpress, and you can use it to check for spam comments by adding one line to your application.yml:

akismet_key: 4bfd15b0ea46

(If you do this, make sure you are requiring the rakismet gem in environment.rb)

Other notes

Any views you create in your app directory will 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 application's app/controllers directory.

Gotchas

I get errors running rake! Error: (wrong number of arguments (3 for 1)

make sure you have the latest version of rake

When upgrading to Rails 2.3, make sure your action_controller.session key is called :key, instead of the old :session_key: