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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:41:04+00:00 2026-06-14T10:41:04+00:00

Working with ember-data is amazing, it steps up to most of my data handling

  • 0

Working with ember-data is amazing, it steps up to most of my data handling challenges out of the box. However, there’s one issue I’ve been digging through Google searches trying to find an answer for.

Say I fire off a GET request to the server to find a record, App.Fruit.find('banana');. If this record doesn’t exist, the backend issues back a status code (404) to the client.

Now, at any given time later on, the ‘banana’ record might be created by somebody else and thus exist in the database on the server.

However, at this point, any further calls to App.Fruit.find('banana'); does not issue a new GET request to the server.

  • I’ve tried calling both banana = App.Fruit.find('banana'); and then banana.get('transaction').rollback(); when the 404 is returned from the server.

  • I’ve also tried App.store.get('defaultTransaction').rollback(); just to see if that worked.

  • I’ve even attempted setting the transaction state to ‘deleted’ – like so: banana.get('stateManager').goToState('deleted'); – hoping it would make the App.Fruit.find('banana'); issue a new GET request afterwards. Unfortunately, it did not.

My question is: how do I make ember-data issue a GET request again if a previous request didn’t return any data (404)?

  • 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-14T10:41:06+00:00Added an answer on June 14, 2026 at 10:41 am

    There appears to be no official way to do this, and that seems to be by design. The store (through which all requests to find a record are proxied) remembers the ids you give it and skips the server call if that id has already been seen.

    In looking at the code, though, there might be a couple tricks for forcing a repeat lookup.

    1. Search by ID

    The store doesn’t remember the queries you use for complex finds. If you tweak your Rails controller’s index action to support these searches, you could query repeatedly like so:

    fruit = App.Fruit.find({id: 'banana'});
    

    Because it’s a search, it will actually return an array—a DS.AdapterPopulatedRecordArray, to be precise. That means you’ll know it worked when fruit.get('length') is greater than 0. It also means you’ll have to grab the first record off the array to use it:

    banana = fruit.objectAtContent(0);
    

    To support this, your Rails controller action will have to look something like this:

    def index
      if params[:id]
        respond_with Fruit.find_all_by_id(params[:id])
      else
        # ...
      end
    end
    

    NB: Make sure you return an array, as that’s what Ember Data will be expecting.

    2. Manual GET, then Sideload

    If you can stomach it, you can perform a manual request to the server. If/when the server responds with the record, you can sideload its JSON into the store:

    store.load(App.Fruit, json)
    

    This will automatically add the attributes to whatever instance of that record you have in memory.

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

Sidebar

Related Questions

I'm working with Ember.Router, and one thing I can't figure out is how to
Need help getting Ember-Data working with Zend Rest. At first, I'm familiar with Zend
I'm working with Ember, Ember-data and Rails. When I create a link in the
I was previously working with Ember.StateManager and now I'm doing some tests before I
I am working on converting a Backbone application into an Ember application using Ember
Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports
Hey everyone, I just finished up an application I've been working on for a
I try to figure out why the following fiddle doesn't work with ember.js 1.0.pre
Is there any way to embed a widget in a data-bound DataGridViewCell when it
The company I work for creates applications for the Blackberry platform. We've been working

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.