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
Erubis debe adelgazar
Search
Gabriel Aramburu
November 28, 2012
Programming
1
60
Erubis debe adelgazar
Mostrar cuán genial es la gema slim.
Gabriel Aramburu
November 28, 2012
Tweet
Share
More Decks by Gabriel Aramburu
See All by Gabriel Aramburu
Crafting API (as a free bird on the fly)
gabamnml
1
69
Other Decks in Programming
See All in Programming
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
310
CSC307 Lecture 06
javiergs
PRO
0
690
CSC307 Lecture 04
javiergs
PRO
0
660
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
180
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
130
CSC307 Lecture 03
javiergs
PRO
1
490
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
290
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
740
Featured
See All Featured
New Earth Scene 8
popppiees
1
1.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Building a Scalable Design System with Sketch
lauravandoore
463
34k
A better future with KSS
kneath
240
18k
GraphQLとの向き合い方2022年版
quramy
50
14k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Mind Mapping
helmedeiros
PRO
0
87
Transcript
ERUBIS DEBE ADELGAZAR
Usando Reduce Fat Fast?
NO! Les presento....
LA INNOVADORA FORMA De adelgazar tu código en las vistas
QUE ES? Y POR QUE USARLO? Es un lenguaje de
plantillas, cuyo objetivo es reducir la sintaxis de las partes esenciales sin llegar a ser críptico.
VEAMOS UNOS EJEMPLOS (Show me the code)
<section class=”container”> <h1>Soy un título</h1> <h2>Soy un Subtítulo</h2> <div class=”content”>
Soy un contenido </div> </section> <section class=”container”> <h1><%= post.title %></h1> <h2><%= post.subtitle %></h2> <div class=”content”> <%= post.content %> </div> </section> section.container h1= post.title h2= post.subtitle .content = post.content Imprimiendo algo SLIM ERB HTML
<% if items.any? %> <table id="items"> <% for item in
items do %> <tr> <td class=”name”><%= item.name %></td> <td class=”price”><%= item.price %></td> </tr> </table> <% else %> <p>No items found.</p> <% end %> <div class=”footer> <%= render 'footer' %> <%= “Copyright © #{year} #{author}” %> </div> - if items.any? table#items - for item in items do tr td.name = item.name td.price = item.price - else p No items found. .footer = render 'footer' | Copyright © #{year} #{author} Quiero mas... SLIM ERB
ALGUNA REGLA? Si! solo debes indentar todo tu código slim
perfectamente.
CÓMO EMPEZAR? $ gem install slim o gem ‘slim’ o
gem ‘slim-rails’ $ slimrb
PUEDO PORTAR MI CÓDIGO ACTUAL? erb2slim: “https://github.com/c0untd0wn/erb2slim” html2slim: “http://html2slim.herokuapp.com/” haml2slim:
“https://github.com/fredwu/haml2slim”
GRACIAS! Gabriel Aramburu (Backend Developer) social = { "@gabamnml" =>
[" "," ”]}