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
0
77
Emberjs
Building an Ember App with Ruby on Rails Part 1
Artur Kremens
October 20, 2014
Tweet
Share
Other Decks in Programming
See All in Programming
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
490
🔨 小さなビルドシステムを作る
momeemt
3
660
モバイルアプリからWebへの横展開を加速した話_Claude_Code_実践術.pdf
kazuyasakamoto
0
310
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
280
TDD 実践ミニトーク
contour_gara
1
290
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
200
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
230
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
2
1.3k
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
18
9.7k
オープンセミナー2025@広島LT技術ブログを続けるには
satoshi256kbyte
0
160
時間軸から考えるTerraformを使う理由と留意点
fufuhu
14
4.4k
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
20
5.1k
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
696
190k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
Designing Experiences People Love
moore
142
24k
Agile that works and the tools we love
rasmusluckow
330
21k
The Language of Interfaces
destraynor
161
25k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Embracing the Ebb and Flow
colly
87
4.8k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
Producing Creativity
orderedlist
PRO
347
40k
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