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
Shared Templates for Rails 3
Search
Alexey
October 01, 2012
Programming
1
160
Shared Templates for Rails 3
Shared Templates for Rails 3
Alexey
October 01, 2012
Tweet
Share
Other Decks in Programming
See All in Programming
What We Can Learn From OSS
inouehi
0
430
使ってみよう Azure AI Document Intelligence
kosmosebi
2
350
大規模UIKitベースアプリへのTCAの段階的導入/gradual-adoption-of-tca-in-a-large-scale-uikit-based-app
takehilo
2
200
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
CDKコントリビュートの最初の壁を越えよう! -簡単issueの見つけ方-
badmintoncryer
2
150
Goのエラースタックトレースの歴史と今後
sonatard
9
1.7k
Ruby Pattern Matching
bkuhlmann
0
930
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
190
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
470
Deep Dive into React Stream/Serialize
mugi_uno
1
250
Sheets API使ってみた
toshi0383
2
150
Implementing Design Systems in Swift
seyfoyun
0
350
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
The Cult of Friendly URLs
andyhume
74
5.7k
Embracing the Ebb and Flow
colly
80
4.2k
Unsuck your backbone
ammeep
663
57k
Optimising Largest Contentful Paint
csswizardry
11
2.4k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
660
120k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
123
39k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
323
20k
Build The Right Thing And Hit Your Dates
maggiecrowley
25
2k
The Invisible Side of Design
smashingmag
294
49k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
Transcript
Shared Templates for Rails 3 EuRuKo 2012 Amsterdam Alexey Vasiliev
Railsware
Hello my name is Alexey Vasiliev (le0pard) @leopard_me https://github.com/le0pard Engineer
at Railsware.com
Ways to render web interface • Rails render content on
backend and send it to browser • Rails backend have only REST API and interface rendered by JavaScript in web application
Hybrid web application • Interface part rendered on backend and
part rendered on frontend • Very often need to use the same templates for backend and frontend • We need DRY!
And we love Mustache!
smt_rails • smt_rails (Shared Mustache Templates for Rails 3) •
gem 'smt_rails' • rails g smt_rails:install • You're done!
Example Template: Hello {{msg}}!!! ActionView: <%= render "tests/test", :mustache =>
{msg: "Test"} %> JavaScript: var content = SMT['tests/test']({msg: "Test"});
sht_rails • sht_rails (Shared Handlebars Templates for Rails 3) •
Build for people who like handlebars.js :)
Example http://smt.rw.rw/
Questions? Ideas? Opinions?