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
Emberjs
Search
Artur Kremens
October 20, 2014
Programming
77
0
Share
Emberjs
Building an Ember App with Ruby on Rails Part 1
Artur Kremens
October 20, 2014
Other Decks in Programming
See All in Programming
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
170
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
250
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
190
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
290
へんな働き方
yusukebe
6
2.9k
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
450
飯MCP
yusukebe
0
420
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.3k
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
220
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
720
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
140
見せてもらおうか、 OpenSearchの性能とやらを!
shunta27
1
160
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
250
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
97
Test your architecture with Archunit
thirion
1
2.2k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
210
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
The browser strikes back
jonoalderson
0
860
We Have a Design System, Now What?
morganepeng
55
8k
RailsConf 2023
tenderlove
30
1.4k
Being A Developer After 40
akosma
91
590k
4 Signs Your Business is Dying
shpigford
187
22k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
Transcript
Emberjs part one http://emberjs.com
What do we need? • gem 'ember-rails' • gem 'bower-rails'
• gem 'emblem-rails' • http://www.ember-cli.com/
Bower - js package manager • Using with RoR ◦
Bowerfile ◦ initializer ◦ install assets rake bower:install (!) • Package manager ◦ http://bower.io
Getting started • Application structure • Application root element EmberApp
= Ember.Application.create({ rootElement: '#ember-application-holder' })
Router • Application route • Index route • Routes extend
EmberApp.Router.map -> @resource 'page', path: '/', -> @resource 'users', path: '/users', -> @route 'show', path: ':id'
Naming conventions • Router: ◦ AppName.PageRoute ◦ page_route.js.coffee • Controller:
◦ AppName.PageController ◦ page_controller.js.coffee • View: ◦ AppName.PageView ◦ page_view.js.coffee • Template: page.emblem
Outlets • Application template {{outlet}} • {{outlet name}} Render template
• @render 'users', {into: 'application'} • @render 'users', {into: 'application', outlet: 'modal'} • @render 'users', {into: 'page', outlet: 'page', controller: controller}
Model • Router set model model: (params) -> AppName.ModelName.find(params.id) •
Class methods AppName.ModelName.reopenClass find: (id = null) -> ...
View • actions and events • classNames ◦ classNameBinding •
tagName • template ◦ templateName ◦ template : Ember.Handlebars.compile('content')
• Router set controller setupController: (controller, model) -> controller.set('varName', 'value')
• Ember.ObjectController • Ember.ArrayController Controller
• binding • collection ◦ each controller.model div {{name}} ◦
each controller.model {{component-name nameInComponent=name}} ◦ {{view Ember.CollectionView contentBinding='data' itemViewClass='viewName'}} Templates
Components • Template component ◦ /templates/components/component-name.emblem • Ember Component ◦
/components/component-name.js.coffee
Computed properties • Depends on id and name isFirst: (->
@get('id') == 1 && (@get('id') == 'Artur') ).property('id', 'name') • Ember.computed.not('isFirst')
Thanks for attention Artur Kremens
[email protected]
+48507224476