Skip to content

Instantly share code, notes, and snippets.

@zeroeth
Created January 18, 2014 04:26
Show Gist options
  • Select an option

  • Save zeroeth/8486196 to your computer and use it in GitHub Desktop.

Select an option

Save zeroeth/8486196 to your computer and use it in GitHub Desktop.
rails ajax
$("button").click(function() {
$.ajax({
type: "POST",
url: "/products",
data: { product: { name: "Filip", description: "whatever" } },
success: function (data) {
alert(data.id);
return false;
},
error: function(data) {
return false;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment