#Voting App
Gemfile
gem 'voting_app'
Bundle
bundle install
Copy migrations
rake voting_app:install:migrations
Run them
rake db:migrate
Mount
#
# routes.rb
#
mount VotingApp::Engine => '/voting_app'
##Promoted Submissions
By default a submission gets promoted when it reaches 10 upvotes, but you can change it by setting the VOTES_LIMIT environment variable
Once a submission has been promoted an admin user will be able to perform actions on it, such as:
- Accept
- Reject
- Complete
-
###Get a list of submissions
-
GET /submissions
-
[ { id: 1 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: null, done_at: null, rejected_at: null, accepted_at: null, votes: 10 }, { id: 2 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: null, done_at: null, rejected_at: null, accepted_at: null, votes: 10 } ]
-
-
-
GET /submissions/:id
-
{ id: 1 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: null, done_at: null, rejected_at: null, accepted_at: null, votes: 10 }
-
-
-
POST /submissions
-
{ id: 1 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: null, done_at: null, rejected_at: null, accepted_at: null, votes: 10 }
-
-
-
POST /submissions/:id/vote
-
{ votes: 10 }
-
-
###Accepting Submissions
-
POST /submissions/:id/accept
-
{ votes: 10 }
-
-
###Rejecting Submissions
-
POST /submissions/:id/reject
-
{ votes: 10 }
-
-
###Completing Submissions A submission can only be marked as done after being accepted
-
POST /submissions/:id/complete
-
{ votes: 10 }
-
-
-
GET /submissions/promoted
-
[ { id: 1 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: '2011-07-24 19:43:37 +0100', done_at: null, rejected_at: null, accepted_at: null, votes: 10 }, { id: 2 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: '2011-07-24 19:43:37 +0100', done_at: null, rejected_at: null, accepted_at: null, votes: 10 } ]
-
-
-
GET /submissions/accepted
-
[ { id: 1 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: '2011-07-24 19:43:37 +0100', done_at: null, rejected_at: null, accepted_at: '2011-07-24 20:43:37 +0100', votes: 10 }, { id: 2 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: '2011-07-24 19:43:37 +0100', done_at: null, rejected_at: null, accepted_at: '2011-07-24 20:43:37 +0100', votes: 10 } ]
-
-
-
GET /submissions/rejected
-
[ { id: 1 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: '2011-07-24 19:43:37 +0100', done_at: null, rejected_at: '2011-07-24 20:43:37 +0100', accepted_at: null, votes: 10 }, { id: 2 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: '2011-07-24 19:43:37 +0100', done_at: null, rejected_at: '2011-07-24 20:43:37 +0100', accepted_at: null, votes: 10 } ]
-
-
-
GET /submissions/done
-
[ { id: 1 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: '2011-07-24 19:43:37 +0100', done_at: '2011-07-24 22:43:37 +0100', rejected_at: null, accepted_at: '2011-07-24 20:43:37 +0100', votes: 10 }, { id: 2 description: 'lorem ipsum ...', created_at: '2011-07-14 19:43:37 +0100', promoted_at: '2011-07-24 19:43:37 +0100', done_at: '2011-07-24 22:43:37 +0100', rejected_at: null, accepted_at: '2011-07-24 20:43:37 +0100', votes: 10 } ]
-
MIT License. Copyright 2011, Crowd Interactive http://www.crowdint.com
Crowd Interactive is a leading Ruby and Rails consultancy firm based in Mexico currently doing business with startups in the United States. We specialize in building and growing your existing development team, by adding engineers onsite or offsite. We pick our clients carefully, as we only work with companies we believe in. Find out more about us on our website.