mandytrex / workout_buddy

0 stars 0 forks source link

accepting a partner request - AJAX #6

Closed mandytrex closed 9 years ago

mandytrex commented 9 years ago

@DrRobotmck @harimohanraj89

pushed my updated code -- specifically in my application.js file in the code below i am attempting to update a users partner_id

// THIS NEEDS TO ACCEPT PARTNERSHIP, ADD PARNTER ID TO EACH PARTNER USER // & DELETE THE REQUEST var acceptPartnership = function(event) { console.log('accept'); var requesterID = event.target.id; console.log("Requester: " + requesterID); var currentUser = $('h2').attr('id'); console.log("Receiver: " + currentUser); var acceptDataCurrentUser = { user: { partner_id: requesterID } }; $.ajax({ url: '/users/' + currentUser, type: 'put', data: acceptDataCurrentUser }); };

the error that i am getting is: PUT http://localhost:3000/users/1 net::ERR_TOO_MANY_REDIRECTS