Skip to content

igorsokolov/acts_as_voteable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ActsAsVoteable
==============

Allows user to vote on the on models.

== Resources

Install
 * Run the following command:
 script/plugin install http://juixe.com/svn/acts_as_voteable
 
 * Generate migration: 
 script/generate acts_as_voteable_migration 
 
 * or 
 
 * Create a new rails migration and add the following self.up and self.down methods
 
  def self.up
    create_table "votes", :force => true do |t|
      t.column "vote", :boolean, :default => false
      t.column "created_at", :datetime, :null => false
      t.column "voteable_type", :string, :limit => 15, :default => "", :null => false
      t.column "voteable_id", :integer, :default => 0, :null => false
      t.column "user_id", :integer, :default => 0, :null => false
    end
  
    add_index "votes", ["user_id"], :name => "fk_votes_user"
  end

  def self.down
    drop_table :votes
  end
 
== Usage

 
 * Make you ActiveRecord model act as voteable.
 
 class Model < ActiveRecord::Base
 	acts_as_voteable
 end

== Credits

Xelipe - This plugin is heavily influenced by Acts As Commentable.

== More

http://www.juixe.com/techknow/index.php/2006/06/24/acts-as-voteable-rails-plugin/
http://www.juixe.com/projects/acts_as_voteable

About

The Acts As Voteable plugin allows for model to be voted on by users.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%