Voluntary

This is a gem which turns your rails application into a crowdsourcing platform to run on your intranet or on the internet.

Then you can add existing voluntary products like text creation or create your own products.

Installation

New Application

Run this in your console:

rvm --create use 1.9.3@your_crowdsourcing_platform_name
gem update bundler
gem install rails -v 3.2.14 --no-rdoc --no-ri  
rails new your_crowdsourcing_platform_name
cd your_crowdsourcing_platform_name

Add this to your Gemfile:

gem 'voluntary'

Add voluntary products to your Gemfile.

Run this in your console:

bundle install

Run this in your console (confirm all overwrite questions):

rails g voluntary:install
rake railties:install:migrations

Remove gem ‘sqlite3’ from your Gemfile.

Copy the content of config/database.example.yml into config/database.yml

Add this to your application.rb:

config.generators do |g|
  g.orm :active_record
end

Remove public/index.html

Add at least 1 controller with 1 action, 1 view and a root route.

Add a Capfile to your Rails root.

Run this in your console:

bundle install
rake db:create
rake db:migrate
rake db:seed
rails s

New Product

git clone https://github.com/user/voluntary_product_name.git
cd voluntary_product_name
rvm --create use --rvmrc 1.9.3@voluntary_product_name
gem update bundler
gem install rails --no-ri --no-rdoc -v=3.2.14
cd ..
rails plugin new voluntary_product_name --database=postgresql --skip-javascript --skip-test-unit --dummy-path=dummy --full
cd voluntary_product_name
# Add voluntary gem as a dependency to gemspec ('0.1.0.rc2').
# add "require 'voluntary'" to lib/voluntary_product_name.rb
# Still needed?: Add development dependencies to dummy Gemfile, see voluntary_text_creation.
# bundle install
cd dummy
# change config/boot.rb to require bundler like here: https://github.com/volontariat/voluntary_scholarship/blob/master/dummy/config/boot.rb
# change database names to #{product_name}_#{environment} and customize user credentials in config/database.yml
# add gitignore file from voluntary: https://github.com/volontariat/voluntary/blob/master/.gitignore
rake db:create:all && rails g voluntary:product_dummy # confirm all overwrite questions
# Add "gemspec path: File.expand_path(File.dirname(__FILE__) + '/../')" to the top of the dummy's Gemfile
bundle install # if it hangs at Fetching source index stop it and deactivate gems until it works and add them back one by one
cd ..
rails g migration add_product_name_product
# fill migration file with template: https://github.com/volontariat/voluntary_scholarship/blob/master/db/migrate/20140306201232_add_scholarship_product.rb
cd dummy
rake railties:install:migrations
# change database names to #{product_name}_#{environment} and customize user credentials in dummy/config/mongoid.yml
rake db:migrate && rake db:test:clone_structure
# create a class for your new product under app/models/product/product_name.rb like: https://github.com/volontariat/voluntary_scholarship/blob/master/app/models/product/scholarship.rb
bundle exec rails s

License

This project uses MIT-LICENSE.