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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Alexey
October 01, 2012
Programming
190
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Shared Templates for Rails 3
Shared Templates for Rails 3
Alexey
October 01, 2012
Other Decks in Programming
See All in Programming
AIエージェントで 変わるAndroid開発環境
takahirom
2
730
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
420
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
550
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
120
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
260
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
590
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
550
5分で問診!Composer セキュリティ健康診断
codmoninc
0
670
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
110
Build-to-own AI: Agentic Development for Humans
inesmontani
PRO
0
100
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
180
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
7k
Featured
See All Featured
Making Projects Easy
brettharned
120
6.7k
WENDY [Excerpt]
tessaabrams
11
39k
Visualization
eitanlees
152
17k
Everyday Curiosity
cassininazir
0
260
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
430
Embracing the Ebb and Flow
colly
88
5.1k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
570
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
340
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
390
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
360
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
390
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
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?