Your controller should do something like this:
That way you can update the count in the view in the callback from the javascript.
You will still need to send the id along to your add_points action.
If you're using rails 3, you may want to try something like this in your routes file:
Then your button code can look like this:
This way the video id will be passed to your controller.
You can call things whatever you like, this is just an example. The important things to note here are
1. :to => "controller#action" which needs to match your actual controller and action
2. :as => "some_name" which means you can refer to the route as some_name_path and some_name_url. This is called "named routes" if you want to google it.
Also, remember that you can call "rake routes" an the command line to see what your routes look like and how you can call them.
There are many other ways of writing the route you need. If your route file looks like this:
Then you can add some code like this:
Then call rake routes to see how to refer to this route in you button_to method. Probably something like
Check out the Rails Guide on routing here for more juicy routing goodness:
http://edgeguides.rubyonrails.org/routing.html
Katrina