Simple polls extension for RefineryCMS engine.
This extension requires Ruby 1.9.x. It's time to upgrade our current ruby base systems.
Include the latest gem into your Refinery CMS application's Gemfile:
gem 'refinerycms-polls', '~> 0.0.4.dev'
Then type the following at command line inside your Refinery CMS application's root directory:
bundle install
To install the migrations, run:
rails generate refinery:polls
rake db:migrate
Add pages to the database and you're done:
rake db:seed
After install "generate refinery:polls" you will have an initializer called refinery/poll.rb, you can modify vote interval there.
Refinery::Polls.configure do |config|
# Configure how long is going to be valid a vote for a guest
config.vote_duration = 1.week
end
You can get all actives polls with:
Refinery::Polls::Question.actives
all questions will be orderer by default with position value in admin reorder functionality.
And pick up one question to render a poll with the partial "poll":
render '/refinery/polls/questions/poll', :question => question
Override default view for partial _poll
You can override the default partial view for a poll replacing this partial:
/refinery/polls/questions/_poll.html.erb
You only need to create that path and file in your app tree.
Add polls to your Refinery site.
In summary you can:
- Create Polls.
- Set anwsers for your polls.
- Set when starts and ends your polls.
- Show results for your polls.
- Set votes for anonymous users by IP addres
- Set duration period to vote. (if a guest vote it will need to wait X time to vote again)
- Documentation"
- [CHANGELOG] (https://github.com/agustinvinao/refinerycms-polls/blob/master/CHANGELOG.md)
- Vote tracking by cookies.
- Documentation
- Tests
- Wiki
RefineryCMS Polls extension is released under the MIT license and is copyright (c) 2012 Agustin Viñao