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
contribution to astral-sh/uv
shunsock
0
550
Introduce Hono CLI
yusukebe
6
3.1k
Google Opalで使える37のライブラリ
mickey_kubo
3
150
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
2
380
理論と実務のギャップを超える
eycjur
0
190
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
950
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
820
三者三様 宣言的UI
kkagurazaka
0
280
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
530
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
650
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
310
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
210
Featured
See All Featured
Designing for Performance
lara
610
69k
The Cult of Friendly URLs
andyhume
79
6.6k
Optimizing for Happiness
mojombo
379
70k
Stop Working from a Prison Cell
hatefulcrawdad
272
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Embracing the Ebb and Flow
colly
88
4.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
2.9k
A Tale of Four Properties
chriscoyier
161
23k
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?