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
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.4k
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
340
Patterns of Patterns
denyspoltorak
0
460
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
190
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
420
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
310
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
230
Graviton と Nitro と私
maroon1st
0
160
Basic Architectures
denyspoltorak
0
200
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
250
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
110
はじめてのカスタムエージェント【GitHub Copilot Agent Mode編】
satoshi256kbyte
0
170
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
97
6.5k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
420
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
56
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
58
41k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
For a Future-Friendly Web
brad_frost
180
10k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
240
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Building an army of robots
kneath
306
46k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.1k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.1k
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" =>
[" "," ”]}