Skip to content

Instantly share code, notes, and snippets.

@Tanner
Created November 19, 2013 22:04
Show Gist options
  • Save Tanner/7553382 to your computer and use it in GitHub Desktop.
Save Tanner/7553382 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
//login
$.ajax({
type: "POST",
url: "/users/sign_in.json",
data: {
user: {
username: "tanner",
password: "tannersmith",
remember_me: true
}
},
success: function(data){
console.log("Successfully logged in");
console.log(data);
$.ajax({
type: "GET",
url: "/forms.json",
success: function(data){
console.log("Successfully got forms.json");
console.log(data);
},
error: function(jqXHR,textStatus,errorThrown ) {
console.log("Unable to get forms.json");
console.log(jqXHR);
console.log(textStatus);
console.log(errorThrown);
}
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment