Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ember Data: (Advanced) Patterns
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Paul Chavard
September 20, 2013
Programming
240
2
Share
Ember Data: (Advanced) Patterns
Slides for my talk from EmberFest 2013
Paul Chavard
September 20, 2013
More Decks by Paul Chavard
See All by Paul Chavard
Le Tour du monde en quatre-vingts jours
tchak
1
43
Functional Ember
tchak
0
290
HTTP
tchak
3
200
Ember Data REBOOT
tchak
0
140
EmberJS Introduction
tchak
1
200
From SproutCore to Ember
tchak
2
250
Ember Data
tchak
11
830
Ember.js
tchak
10
1.6k
Other Decks in Programming
See All in Programming
🦞OpenClaw works with AWS
licux
1
190
Swift Concurrency Type System
inamiy
1
540
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
840
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
3
280
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
170
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
160
2026_04_15_量子計算をパズルとして解く
hideakitakechi
0
110
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
230
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
240
Liberating Ruby's Parser from Lexer Hacks
ydah
2
1.9k
iOS機能開発のAI環境と起きた変化
ryunakayama
0
190
実用!Hono RPC2026
yodaka
2
250
Featured
See All Featured
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
43k
Ethics towards AI in product and experience design
skipperchong
2
260
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
My Coaching Mixtape
mlcsv
0
110
Producing Creativity
orderedlist
PRO
348
40k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
110
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.7k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
220
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
Transcript
Ember Data (Advanced) Patterns Paul Chavard Capitaine Train August 30,
2013
Capitaine Train capitainetrain.com • 55 controllers • 22 models
I am going to show you some useful stuff that
actualy works (most of the time) in Ember Data
Filters Dynamic Filter var IndexRoute = Ember.Route.extend ({ model: function
() { return this.store.filter(’post ’, {}, Ember.K); } }); var IndexController = Ember. ArrayController .extend ({ searchText : ’’, searchTextDidChange : function () { var searchText = this.get(’searchText ’). toLowerCase (); var filterFunction = Ember.isEmpty(searchText ) ? Ember.K : function(record) { return record.get(’title ’). toLowerCase () .match( searchText ); }; this.set(’content. filterFunction ’, filterFunction ); }. observes(’searchText ’) });
Batch Saves Save Multiple Models Ember.RSVP.all(post.get(’comments ’). invoke(’save ’)) .then(function
() { alert(’All Saved!’); }, function(reason) { alert(’There was an error because ’ + reason ); }); Save Parent Before Child post.save (). then(function () { return comment.save (); }). then(function () { alert(’All Saved!’); }, function(reason) { alert(’There was an error because ’ + reason ); });
Unload Records Unload Single Record this.store.find(’post ’, 1). unloadRecord ();
Unload Record with its Relationships var Post = DS.Model.extend ({ unloadRecord : function () { this._super (); this. eachRelationship (function(key , relationship ) { if ( relationship .kind === ’hasMany ’) { this.get(key ). toArray (). invoke(’unloadRecord ’); } else { this.get(key ). unloadRecord (); } }, this ); } }); this.store.find(’post ’, 1). unloadRecord ();
Ember Extention
The End