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
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
1
140
哲学史とモデリング
tanakahisateru
4
440
Jetpack Composeとデザインシステム
rmakiyama
0
250
Using "modern" Ruby to build a better, faster Homebrew
mikemcquaid
2
310
Documentation testsの恩恵 / Documentation testing benefits
ssssota
1
580
slog登場に伴うloggerの取り回し手法の見直し / kamakura.go #6
arthur1
0
180
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
2
75k
FoodGram
iseruuuuu
0
230
Embedding it into Ruby code
soutaro
2
540
Vanilla JavaScript はマルチプラットフォームの夢を見るか
mitsuharu
0
100
TSKaigi 2024 - 新サービス Progate Path の演習で TypeScript を採用して見えた教材観点からの利点と課題
makotoshimazu
1
230
Improved REXML XML parsing performance using StringScanner
naitoh
0
120
Featured
See All Featured
Infographics Made Easy
chrislema
238
18k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
323
20k
Design by the Numbers
sachag
274
18k
How to Ace a Technical Interview
jacobian
273
22k
Music & Morning Musume
bryan
41
5.6k
Clear Off the Table
cherdarchuk
86
310k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
GraphQLの誤解/rethinking-graphql
sonatard
56
9.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
67
14k
What the flash - Photography Introduction
edds
64
11k
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?