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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
220
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
740
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
AI & Enginnering
codelynx
0
110
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
高速開発のためのコード整理術
sutetotanuki
1
400
2026年 エンジニアリング自己学習法
yumechi
0
140
Raku Raku Notion 20260128
hareyakayuruyaka
0
320
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
270
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
360
今から始めるClaude Code超入門
448jp
8
8.9k
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
Unsuck your backbone
ammeep
671
58k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.7k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
180
How to make the Groovebox
asonas
2
1.9k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
110
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
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" =>
[" "," ”]}