Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bborn committed Dec 7, 2012
1 parent 540f2b0 commit 6126087
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
48 changes: 24 additions & 24 deletions README.markdown
@@ -1,20 +1,20 @@
** Using Rails 2.x? You want the [master branch](https://github.com/bborn/communityengine)
** Using Rails 2.x? You want the [rails2.x branch](https://github.com/bborn/communityengine/tree/rails2.x)

CommunityEngine [![Build Status](https://secure.travis-ci.org/bborn/communityengine.png)](http://travis-ci.org/bborn/communityengine)

Information at: [http://www.communityengine.org](http://www.communityengine.org)

Requirements:

- RAILS VERSION 3.2
- RAILS VERSION 3.2.8

Getting CommunityEngine Running
--------------------------------

1. Copy the following into your `Gemfile`:

```
gem 'community_engine', :git => 'bborn/communityengine', :branch => 'rails3'
gem 'community_engine'
```

2. Add a file called `application_config.rb` to your `config` directory. In it put (at least):
Expand All @@ -34,14 +34,14 @@ Getting CommunityEngine Running

5. Delete the default `views/layouts/application.html.erb` that Rails created for you. Delete `public/index.html` if you haven't already.

6. Start your server!
6. Start your server!

$ bin/rails server

Optional Configuration
======================

To override the default configuration, create an `application_config.rb` file in `Rails.root/config`
To override the default configuration, create an `application_config.rb` file in `Rails.root/config`

The application configuration defined in this file overrides the one defined in the [CommunityEngine gem](https://github.com/bborn/communityengine/blob/rails3/config/application_config.rb)

Expand All @@ -67,7 +67,7 @@ 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 to add a file called `s3.yml` to the application's root config directory (examples are in `/community_engine/sample_files`).
To use Amazon S3 as the backend for your file uploads,you'll need to add a file called `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_config.rb` to tell CommunityEngine to use s3 as the photo backend. For more, see the Paperclip documentation on S3 storage for uploads: https://github.com/thoughtbot/paperclip/blob/master/lib/paperclip/storage/s3.rb

Expand All @@ -84,9 +84,9 @@ Once logged in as an admin, you'll be able to toggle other users between moderat

Admins and moderators can edit and delete other users posts.

There is a rake task to make an existing user into an admin:
There is a rake task to make an existing user into an admin:

rake community_engine:make_admin email=user@foo.com
rake community_engine:make_admin email=user@foo.com

(Pass in the e-mail of the user you'd like to make an admin)

Expand All @@ -97,10 +97,10 @@ Localization

Localization is done via Rails native I18n API. We've added some extensions to String and Symbol to let them respond to the `.l` method. That allows for a look up of the symbol (or a symbolized version of the string).

For complex strings with substitutions, Symbols respond to the `.l` method with a hash passed as an argument, for example:
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}"
Expand All @@ -111,51 +111,51 @@ To customize the language, or add a new language create a new yaml file in `Rail
Spam Control
------------

Spam sucks. Most likely, you'll need to implement some custom solution to control spam on your site, but CE offers a few tools to help with the basics.
Spam sucks. Most likely, you'll need to implement some custom solution to control spam on your site, but CE offers a few tools to help with the basics.

ReCaptcha: to allow non-logged-in commenting and use [ReCaptcha](http://recaptcha.net/) to ensure robots aren't submitting comments to your site, just add the following lines to your `application_config.rb`:

:allow_anonymous_commenting => true,
:recaptcha_pub_key => YOUR_PUBLIC_KEY,
:recaptcha_priv_key => YOUR_PRIVATE_KEY

You can also require ReCaptcha on signup (to prevent automated signups) by adding this in your `application_config.rb` (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 too. [Akismet](http://akismet.com/) 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_config.rb`:

:akismet_key => YOUR_KEY


Integrating with Your Application & Overriding CE
-------------------------------------------------

To make a controller from your application use CE's layout and inherit CE's helper methods, make it inherit from `BaseController`. For example:

class RecipesController < BaseController

before_filter :login_required
before_filter :login_required

uses_tiny_mce do
{:only => [:show], :options => configatron.default_mce_options}
end
end

end

To override or modify a controller, helper, or model from CE, you can use the `require_from_ce` helper method. For example, to override a method in CE's `User` model, create `app/models/user.rb`:

class User < ActiveRecordBase
require_from_ce('models/user')

#add a new association
has_many :recipes

#override an existing method
def display_name
login.capitalize
end

end


Expand All @@ -174,7 +174,7 @@ Contributors - Thanks! :)
- Bryan Kearney - localization
- Alex Nesbitt - forgot password bugs
- Alejandro Raiczyk - Spanish localization
- [Fritz Thielemann](http://github.com/fritzek) - German localization, il8n
- [Fritz Thielemann](http://github.com/fritzek) - German localization, il8n
- [Oleg Ivanov](http://github.com/morhekil) - `acts_as_taggable_on_steroids`
- David Fugere - French localization
- Barry Paul - routes refactoring
Expand Down
3 changes: 1 addition & 2 deletions lib/community_engine/version.rb
Expand Up @@ -3,8 +3,7 @@ module Version
MAJOR = 2
MINOR = 0
PATCH = 0
BUILD = 'beta4'

STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
end
end
end

0 comments on commit 6126087

Please sign in to comment.