Closed janicemin closed 9 years ago
url:"/closets/update",
this is not the url for updating items. I think you need url:"/closets/3"
or the id of the closet that you're updating.
i tried an id and still getting the same error...
can you post your code and / or visit the genius bar / or push code to github
it still looks like you're using the update url? https://github.com/janicemin/project3-canborrow/blob/master/app/assets/javascripts/application.js#L41
i changed it in my latest code. that's the one i want to keep in case i f things up :)
i'm just not sure where to go from here. i can get it to borrow and persist in the database as i want as a rails, but i'm trying to make this an ajax call so i can meet the requirements....
ok id be happy to take a look if you paste the update you made in here
url:"/closets/update" + 'profileId',
just trying something.
hey @jshawl , could you point me into the right direction of how i should set it up? just not sure...
params = { profileID: $(this).data('profileId'), }; url:"/closets/update" + profileID
is that kind of where i'm supposed to be?
i got an undefined profileID error, so i am trying to define it within the drop function....
Trying to drag an article of clothing from an owner's closet to a borrower's closet and retain garment ID and when they're dropped into another div element?
i keep getting an error that says in the console: Failed to load resource: the server responded with a status of 404 (Not Found) jquery.self-d03a5518f45df77341bdbe6201ba3bfa547ebba8ed64f0ea56bfa5f96ea7c074.js?body=1:9660 POST http://localhost:3000/closets/update 404 (Not Found)
$( ".draggable" ).draggable({ snap: true, drag: function() { params = { id: $(this).data('garmentId'), profileID: $(this).data('profileId'), name: $(this).data('name') };
} });
$( ".column-style" ).droppable({ activeClass: "ui-state-default", hoverClass: "ui-state-hover", drop: function( event, ui ) { params.method = "update"; $.ajax({ method: "post", url:"/closets/update", data: $.param(params) }); // console.log('hi'); // console.log($(this).data('index')); } });