so I have code in JavaScript I am trying to rewrite in Ruby and I can't figure out how to pass these parameters and parse the response in the same way with Ruby that I do in JavaScript
The javascript code:
$.post(urlToPostTo, {
name: nameToPost,
captchatext: "",
index: "0"
}).done(function (response) {
var responseHTML = $.parseHTML(response);
var tables = $(responseHTML).find("td");
self.pA = $(tables[2]).text();
self.dA = $(tables[3]).text();
self.mR = $(tables[4]).text();
deferred.resolve(data);
}).fail(function (error) {
deferred.resolve(data);
});
Is there a way I can do this in Ruby (potentially with HTTParty)?