Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ember and Rails
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Steve Kinney
December 17, 2014
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ember and Rails
Steve Kinney
December 17, 2014
Transcript
40 slides
Ember ♥ Rails DeRailed, December 2014
Hi. I'm Steve. @stevekinney
None
Hire our students, please: http://people.turing.io/
Ember Basics
Ember draws influence from Cocoa and Rails. It began it's
life as SproutCore 2.0.
Notable Features Two-way data binding Computed properties An emphasis on
URLs Convention over configuration
None
Let's look at some code.
Public Service Announcement: TurboLinks Considered Harmful
A Tale of Two MVCs
Ember and Rails both take MVC pretty seriously. (That said,
they both have a very different take on it.)
None
None
The route fetches the model and sets up the controller.
Controllers decorate the model and handle actions.
Controllers are singletons.
Let's say you visit /notes/1 and then you visit /notes/2.
It's the same controller, but the route has switched out the model.
Controllers maintain state.
Controllers can talk to each other.
What is Ember Data?
It's kind of like ActiveRecord, but for Ember—and different.
None
// models/post.js export default DS.Model.extend({ title: DS.attr('string'), body: DS.attr('text'), comments:
DS.hasMany('comments') }); // models/comment.js export default DS.Model.extend({ comment: DS.attr('string'), post: DS.belongsTo('post') });
And Now: An Example of the AJAX Requests Generated By
Ember Data
post.find('12').get('comments');
post.get('comments'); GET /posts { "posts": [ { "id": "12", "content":
"Super!", "comments": ["56", "58"] } ] }
GET /comments?ids[]=56&ids[]=58 { "comments": [ { "id": "56", "message": "Whatever",
"post": "12" }, { "id": "58", "message": "Something", "post": "12" } ] }
What just happened? Ember Data sent off two AJAX requests
to Rails in order to build the relation in the browser.
And then it cached the result in the Store.
Let's look at some code together.
Ember Tooling
The Ember Inspector
None
None
It's like the Rails command line tools, but for Ember—
and not that different.
None
Ember CLI allows you to proxy to a Rails server.
Request If Ember can't respond to a URL, it proxies
it on to Rails.
Thank you. Questions?
More Decks by Steve Kinney
See All by Steve Kinney
Enterprise UI, v2
stevekinney
0
350
React_Performance__2022.pdf
stevekinney
0
56
React Performance v2
stevekinney
0
100
Introduction to Testing
stevekinney
0
210
Web Security, Frontend Masters
stevekinney
0
4.6k
Making Music with the Web Audio API, JSConf Colombia 2023
stevekinney
0
150
React and TypeScript, Turing School
stevekinney
0
410
Redux Workshop, 2021-05-05
stevekinney
2
2.3k
TypeScript and React Utility Types
stevekinney
1
250
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
Done Done
chrislema
187
17k
Building Adaptive Systems
keathley
44
3.3k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
6
940
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
640
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
620
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Deep Space Network (abreviated)
tonyrice
0
420