If you are willing to go for non-integer values as well. I will suggest you to use the plugin raty. Its a very simple plugin and can be used to highlight based on a number.
for your problem to save in the database. You can send an ajax and get the field updated.
var score = save the current score;
$.ajax({
type: 'post',
url : 'url/you/want'
data: { rating : score, id: id}
success : function(){
//do what you want
}
})
according to the above ajax, the value will be posted to the action where the url
points to and will be posted there.
Inside that method you can receive the parameter to save it.
def methodname
if params[:rating]
@movie = Movie.find(params[:id])
@movie.update_attributes(:rating => params[:rating])
end
end