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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
AI時代の認知負荷との向き合い方
optfit
0
160
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
130
今から始めるClaude Code超入門
448jp
8
8.9k
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
100
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
460
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.6k
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
430
高速開発のためのコード整理術
sutetotanuki
1
400
組織で育むオブザーバビリティ
ryota_hnk
0
180
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
Featured
See All Featured
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
440
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
The browser strikes back
jonoalderson
0
390
Music & Morning Musume
bryan
47
7.1k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Testing 201, or: Great Expectations
jmmastey
46
8k
The untapped power of vector embeddings
frankvandijk
1
1.6k
Crafting Experiences
bethany
1
49
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
330
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" =>
[" "," ”]}