Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8032713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:28:07+00:00 2026-06-05T01:28:07+00:00

I have a very basic backbone (sample) application which just creates and destroys model

  • 0

I have a very basic backbone (sample) application which just creates and destroys model items. When the model is created the object is persisted with a POST to the web server, but when the model is destroyed there is no DELETE sent to the server? Any idea why this might be?

very basic model:

window.User = Backbone.Model.extend({
  urlRoot: 'users'
});

my test code just to create and delete the model:

var model = null;

$(".add").click(function(){
  if (model == null) {
    model = new window.User;
    model.set({name: 'meeee'});
    model.save();
  }
});

$(".remove").click(function(){
  if (model != null) {
    model.destroy();
  }
});

The JSON response when creating the model seems good too:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:28:09+00:00Added an answer on June 5, 2026 at 1:28 am

    Backbone doesn’t know that _id is the name you are using for your id field, unless you’ve modified your copy of Backbone.js somehow (please don’t). To tell Backbone what the name of your id field is for some particular model, idAttribute in your Model definition. Otherwise, it defaults to the regular id.

    Without the “identity” field set, Backbone is going to consider that the the model instance “isNew” (a model instance which hasn’t been persisted to the server), so when there’s no “identity” (as in your case, as it doesn’t know that your identity is, instead, _id) there wouldn’t be any need to destroy it on the server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very basic entity model which I'm trying to add custom validation
I have very basic QT application (just create to explain my problem). So here
I have a very basic query string which passes a ID to a receiving
I have a very basic model - User I am trying to do some
I have a very basic fragment shader which I want to output 'gl_PrimitiveID' to
I have a very basic regular expression that I just can't figure out why
I have a very basic application done in Sinatra I have deployed it in
I have a very basic question. When we compile a VS 2005 C# application,
I have a very basic function which I am using jQuery to slide some
I have a very basic web crawler. The database table which stores the links

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.