ember-learn / ember-learn/guides-source

Re-use Ember Data examples instead of changing types

Open
#760 1 comment 0 reactions 0 assignees View on GitHub
ember-data
Dominant language
HTML
Stars
161
Forks
512
Avg merge
4d 9h
Merged PRs (30d)
4

Description

Copied over from https://github.com/emberjs/ember.js/issues/17956 created by @pink-cupcakes:

I wanted to provide feedback on the data models documentation: I would recommend starting in the order of going through CREATE before going through FIND methods. There's nothing to find if you follow the documentation, for example:

`this.store.findRecord('blog-post', 1) ` - returns a 404 for me

Secondly, this wouldn't be such an issue if the examples were consistent. The example for findRecord above is blog-post, but then if you go to the create, update, delete documentation, we have:

`store.createRecord('post', {
title: 'Rails is Omakase',
body: 'Lorem ipsum'
});`

Or we have a Person model:
`person.get('isAdmin'); // => false
person.get('hasDirtyAttributes'); // => false
person.set('isAdmin', true);
person.get('hasDirtyAttributes'); // => true
person.changedAttributes(); // => { isAdmin: [false, true] }`

Which outside of this chunk, is never referenced anywhere - the example lives in isolation, leaving your mental model of how these methods can interact, incomplete.

These are just feedback from someone new to Ember and trying to figure this out as quickly as possible to POC ideas. Even if the documentation is continuous (borrowing from examples from previous sections), the documentation should be strong enough to stand in isolation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.