I use this function on a js file and it works
$(function() {
$("#badgebutton").click(function() {
var assertions = [
"http://www.exemple.com/patents/5555/badge.json"
];
OpenBadges.issue(assertions, function(errors, successes) {
console.log("callback called");
console.log("Errors:", errors);
console.log("Successes:", successes);
});
});
});
In place of the number :
"http://www.exemple.com/patents/5555/badge.json"
I would like to use the patent.id. I tried this :
"http://www.exemple.com/patents/#{@patent.id}/badge.json"
and some other solution without success..