Had to make a method called rate_json to handle an ajax request.