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

  • SEARCH
  • Home
  • 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 6956935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:56:02+00:00 2026-05-27T14:56:02+00:00

(Rails 3 + backbone 0.53) I am fetching data from my API on /payments

  • 0

(Rails 3 + backbone 0.53)
I am fetching data from my API on “/payments” url and it returns different kinds of payment data.

So the user can for example delete, let’s say a credit-card entry and it is synced backed to the server on

"/credit_cards".

The problem is that if I use Backbone.Sync with the syntax

Backbone.Sync('delete', @options.credit_cards.get('id')) 

it gives me an “A “url” property or function must be specified” error.

This makes sense as the model e.g.:

@options.credit_cards.get('id') 

does not exist in this case because credit_cards doesn’t store any data. I just wanna do a standard DELETE with Backbone.sync á la

"/credit_cards/:id" 

but just by specifying the id (which I receive from /payments) not the model (but the model/collection has the url…)

So my question is: 1.)
is there a way in backbone to use backbone.sync without actually storing data in a collection/model, more like a simple ajax request with jQuery.
Example:

Backbone.Sync('delete', "specify_a_url_here_with/#{id}"))

instead of using Backbone.Sync & $.ajax requests mixed.

2.) does that make sense at all or is there a better alternative.

Thanks a lot! I really love SO! Hope the question isn’t to weird. Phil

  • 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-05-27T14:56:03+00:00Added an answer on May 27, 2026 at 2:56 pm

    You can pass “url” and “data” to Backbone.Sync in “options”.

    Backbone.sync(method, model, options) returns a $.ajax(params) where params.url and params.data reflect your model unless you exlicitly pass them in options.

    So

    Backbone.sync('delete', false, {url : "/credit_cards/1", data : ''}) 
    

    should work.

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

Sidebar

Related Questions

I have a backbone application which, upon load, needs to fetch data from four
tutorial: http://www.jamesyu.org/2011/01/27/cloudedit-a-backbone-js-tutorial-by-example/ I am going through the CloudEdit rails/backbone.js tutrorial and got stuck on
I am working on a backbone.js application with rails api which provides the json
I'm trying to follow this Rails/Backbone example but they are using erb and not
I'm using codebrew\backbone-rails in a nested model example (say I have a collection of
I've been following the cloudedit tutorial http://www.jamesyu.org/2011/01/27/cloudedit-a-backbone-js-tutorial-by-example/ for adding backbone to my rails app,
I am working on a backbone.js application with rails api which provides the json
Rails comes with a handy session hash into which we can cram stuff to
Rails introduced some core extensions to Ruby like 3.days.from_now which returns, as you'd expect
Rails gurus: I've just discovered named_scope thanks to another SO user. :) I'd like

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.