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
62
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Erubis debe adelgazar
Mostrar cuán genial es la gema slim.
Gabriel Aramburu
November 28, 2012
More Decks by Gabriel Aramburu
See All by Gabriel Aramburu
Crafting API (as a free bird on the fly)
gabamnml
1
70
Other Decks in Programming
See All in Programming
どこまでゆるくて許されるのか
tk3fftk
0
470
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
150
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.4k
OS アップデート対応の取り組み方がもっと共有されてほしい
andpad
0
110
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
14
6.8k
エンジニアにデザインハーネスを 〜デザインプロセスを規定するためのハーネス〜 / Design harness from an engineer's perspective
rkaga
2
1.3k
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
170
スマートグラスで並列バイブコーディング
hyshu
0
280
Contextとはなにか
chiroruxx
1
390
act1-costs.pdf
sumedhbala
0
210
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
250
symfony/aiとlaravel/boost
77web
0
120
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
460
How GitHub (no longer) Works
holman
316
150k
Code Reviewing Like a Champion
maltzj
528
40k
Fireside Chat
paigeccino
42
4k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.7k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
170
YesSQL, Process and Tooling at Scale
rocio
174
15k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
290
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
150
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The untapped power of vector embeddings
frankvandijk
2
1.8k
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" =>
[" "," ”]}