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 9136753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:59:40+00:00 2026-06-17T08:59:40+00:00

I have a model like this: define([ ‘jquery’, ‘backbone’ ], function ($) { var

  • 0

I have a model like this:

    define([
    'jquery',
    'backbone'
], function ($) {
    var MyModel = Backbone.Model.extend({


        url: 'articles/',

        initialize: function(){

        }

    });

    return MyModel;
});

And this is the code for saving the object:

        article = new Article();

        status = t.currentTarget.textContent;
        article.set('ready', {'status': status});

        coords = this.model.get('location').coords;
        article.set('geo', {'lat': coords.latitude, 'lng': coords.longitude});

        article.save(null, { accessToken: true }).done(function(){
            self.hideIcons();
        });

But when I do the PATCH:

this.article.save({comment: comment}, {patch: true, accessToken: true});

The request is correctly PATCH, but the endpoint is wrong, the request is like this:

PATCH mydomain.com/articles/

As you can see, should be:

PATCH mydomain.com/articles/<last-model-id-created>/

Thanks.

  • 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-17T08:59:41+00:00Added an answer on June 17, 2026 at 8:59 am

    Instead of setting the Model.url property, you should set Model.urlRoot. From the docs:

    Specify a urlRoot if you’re using a model outside of a collection, to enable the default url function to generate URLs based on the model id. “[urlRoot]/id”

    If the model belongs to a collection, you can leave Model.urlRoot unspecified as well and set Collection.url instead.

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

Sidebar

Related Questions

I have a model which looks like this: //myModel.js define([], function () { var
I am trying to define a dataModel something like this: var MyDataModel = kendo.data.Model.define({
I have a Code model factory like this: Factory.define :code do |f| f.value code
I have a custom class that looks like this: qx.Class.define('test.Table2', { extend: qx.ui.table.Table, construct:
I have a Link and a Bookmark model like this: class Link(models.Model): url =
I have model like this: scope :search_posts, lambda { |query| mega_posts.where( title LIKE ?
i've a problem with my tabularinline field. I have model like this class Product(models.Model):
I have a model like this: class Users(db.Model): email = db.EmailProperty(required=True, indexed=True) user_name =
I have entity model like this (using EclipseLink and JPA 2.0): @Entity class A
So I have a model like this: class MyClass { public $customer = null;

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.