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
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
310
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.4k
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
180
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
21
7.3k
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
710
Featured
See All Featured
Leo the Paperboy
mayatellez
4
1.4k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Paper Plane
katiecoart
PRO
0
46k
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
430
The Pragmatic Product Professional
lauravandoore
37
7.1k
The Invisible Side of Design
smashingmag
302
51k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
The Curse of the Amulet
leimatthew05
1
8.6k
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" =>
[" "," ”]}