galetahub/ballot_box — Issue #1: Getting a 422 error
Author: natebird
Created: 2012-02-29 03:31:35+00:00
State: open

I am trying to allow people to vote on my Video model. Here is the code I've inserted so far:

**Gemfile**

```
gem 'ballot_box'
```

Ran generator and migrated

```
rails generate ballot_box:install
rake db:migrate
```

**models/video.rb**

```
ballot_box :counter_cache => :likes,
:strategies => [:authenticated],
:place => :position
```

**views/videos/index.html.erb**

```
<%= link_to 'Vote', "/videos/votes?id=#{video.id}", :remote => true, :method => :post %>
```

**config/application.rb**

```
config.app_middleware.use BallotBox::Manager do |config|
config.routes = { "/videos/votes" => "Video" }
end
```

Am I missing some piece of this?