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
180
Shared Templates for Rails 3
Shared Templates for Rails 3
Alexey
October 01, 2012
Tweet
Share
Other Decks in Programming
See All in Programming
AIのメモリー
watany
13
1.3k
ZeroETLで始めるDynamoDBとS3の連携
afooooil
0
150
CEDEC2025 長期運営ゲームをあと10年続けるための0から始める自動テスト ~4000項目を50%自動化し、月1→毎日実行にした3年間~
akatsukigames_tech
0
100
バイブコーディングの正体——AIエージェントはソフトウェア開発を変えるか?
stakaya
5
790
Constant integer division faster than compiler-generated code
herumi
2
440
Workers を定期実行する方法は一つじゃない
rokuosan
0
140
iOS開発スターターキットの作り方
akidon0000
0
240
新世界の理解
koriym
0
130
DataformでPythonする / dataform-de-python
snhryt
0
150
Comparing decimals in Swift Testing
417_72ki
0
160
Reactの歴史を振り返る
tutinoko
1
170
抽象化という思考のツール - 理解と活用 - / Abstraction-as-a-Tool-for-Thinking
shin1x1
1
940
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
45
7.6k
Adopting Sorbet at Scale
ufuk
77
9.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
332
22k
Facilitating Awesome Meetings
lara
54
6.5k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Six Lessons from altMBA
skipperchong
28
3.9k
Done Done
chrislema
185
16k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
880
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
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?