Enviar búsqueda
Cargar
Get Slim!
•
0 recomendaciones
•
2,179 vistas
Simon Courtois
Seguir
Slides of my talk at Paris.rb on 2014-06-03 about the Slim templating syntax.
Leer menos
Leer más
Software
Denunciar
Compartir
Denunciar
Compartir
1 de 23
Descargar ahora
Descargar para leer sin conexión
Recomendados
Understanding the Nesting Structure of the Ember.js View Layer
Understanding the Nesting Structure of the Ember.js View Layer
Kevin Ball
ITB2016 - Mixing up the front end with ColdBox elixir
ITB2016 - Mixing up the front end with ColdBox elixir
Ortus Solutions, Corp
Plone for Education: Bibliographies
Plone for Education: Bibliographies
Cristopher Ewing
Building Enterprise Search Engines using Open Source Technologies
Building Enterprise Search Engines using Open Source Technologies
Rahul Singh
How to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHP
Dana Luther
Different ways of integrating React into Rails - Mikhail Bortnyk
Different ways of integrating React into Rails - Mikhail Bortnyk
Ruby Meditation
Rails 6 Multi-DB 実戦投入
Rails 6 Multi-DB 実戦投入
kiyots
Scaling with swagger
Scaling with swagger
Tony Tam
Recomendados
Understanding the Nesting Structure of the Ember.js View Layer
Understanding the Nesting Structure of the Ember.js View Layer
Kevin Ball
ITB2016 - Mixing up the front end with ColdBox elixir
ITB2016 - Mixing up the front end with ColdBox elixir
Ortus Solutions, Corp
Plone for Education: Bibliographies
Plone for Education: Bibliographies
Cristopher Ewing
Building Enterprise Search Engines using Open Source Technologies
Building Enterprise Search Engines using Open Source Technologies
Rahul Singh
How to analyze your codebase with Exakat using Docker - Longhorn PHP
How to analyze your codebase with Exakat using Docker - Longhorn PHP
Dana Luther
Different ways of integrating React into Rails - Mikhail Bortnyk
Different ways of integrating React into Rails - Mikhail Bortnyk
Ruby Meditation
Rails 6 Multi-DB 実戦投入
Rails 6 Multi-DB 実戦投入
kiyots
Scaling with swagger
Scaling with swagger
Tony Tam
SINATRA + HAML + TWITTER
SINATRA + HAML + TWITTER
Elber Ribeiro
What’s New in Rails 5.0?
What’s New in Rails 5.0?
Unboxed
Modern javascript
Modern javascript
Kevin Ball
Mistakes
Mistakes
ArrrrCamp
High Performance Rails with MySQL
High Performance Rails with MySQL
Jervin Real
Backing Data Silo Atack: Alfresco sharding, SOLR for non-flat objects
Backing Data Silo Atack: Alfresco sharding, SOLR for non-flat objects
ITD Systems
Change Management for Oracle Database with SQLcl
Change Management for Oracle Database with SQLcl
Jeff Smith
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Puppet
How DSL works on Ruby
How DSL works on Ruby
Hiroshi SHIBATA
RoR 101: Session 2
RoR 101: Session 2
Rory Gianni
How to Make SQL Server Go Faster
How to Make SQL Server Go Faster
Brent Ozar
Html5 Brown Bag
Html5 Brown Bag
stuplum
Killing the Angle Bracket
Killing the Angle Bracket
jnewmanux
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
Metosin Oy
Jasig rubyon rails
Jasig rubyon rails
_zaMmer_
Jasig rubyon rails
Jasig rubyon rails
_zaMmer_
Chaione Ember.js Training
Chaione Ember.js Training
aortbals
Ruby Masters 2011
Ruby Masters 2011
Fabio Akita
Site speed Server Optimization
Site speed Server Optimization
Shelly Fagin
面向测试的前端知识
面向测试的前端知识
chencheng 云谦
Conseils pour un lancement Product Hunt réussi
Conseils pour un lancement Product Hunt réussi
Simon Courtois
Organize your assets with Rails
Organize your assets with Rails
Simon Courtois
Más contenido relacionado
Similar a Get Slim!
SINATRA + HAML + TWITTER
SINATRA + HAML + TWITTER
Elber Ribeiro
What’s New in Rails 5.0?
What’s New in Rails 5.0?
Unboxed
Modern javascript
Modern javascript
Kevin Ball
Mistakes
Mistakes
ArrrrCamp
High Performance Rails with MySQL
High Performance Rails with MySQL
Jervin Real
Backing Data Silo Atack: Alfresco sharding, SOLR for non-flat objects
Backing Data Silo Atack: Alfresco sharding, SOLR for non-flat objects
ITD Systems
Change Management for Oracle Database with SQLcl
Change Management for Oracle Database with SQLcl
Jeff Smith
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Puppet
How DSL works on Ruby
How DSL works on Ruby
Hiroshi SHIBATA
RoR 101: Session 2
RoR 101: Session 2
Rory Gianni
How to Make SQL Server Go Faster
How to Make SQL Server Go Faster
Brent Ozar
Html5 Brown Bag
Html5 Brown Bag
stuplum
Killing the Angle Bracket
Killing the Angle Bracket
jnewmanux
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
Metosin Oy
Jasig rubyon rails
Jasig rubyon rails
_zaMmer_
Jasig rubyon rails
Jasig rubyon rails
_zaMmer_
Chaione Ember.js Training
Chaione Ember.js Training
aortbals
Ruby Masters 2011
Ruby Masters 2011
Fabio Akita
Site speed Server Optimization
Site speed Server Optimization
Shelly Fagin
面向测试的前端知识
面向测试的前端知识
chencheng 云谦
Similar a Get Slim!
(20)
SINATRA + HAML + TWITTER
SINATRA + HAML + TWITTER
What’s New in Rails 5.0?
What’s New in Rails 5.0?
Modern javascript
Modern javascript
Mistakes
Mistakes
High Performance Rails with MySQL
High Performance Rails with MySQL
Backing Data Silo Atack: Alfresco sharding, SOLR for non-flat objects
Backing Data Silo Atack: Alfresco sharding, SOLR for non-flat objects
Change Management for Oracle Database with SQLcl
Change Management for Oracle Database with SQLcl
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
How DSL works on Ruby
How DSL works on Ruby
RoR 101: Session 2
RoR 101: Session 2
How to Make SQL Server Go Faster
How to Make SQL Server Go Faster
Html5 Brown Bag
Html5 Brown Bag
Killing the Angle Bracket
Killing the Angle Bracket
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
Schema tools-and-trics-and-quick-intro-to-clojure-spec-22.6.2016
Jasig rubyon rails
Jasig rubyon rails
Jasig rubyon rails
Jasig rubyon rails
Chaione Ember.js Training
Chaione Ember.js Training
Ruby Masters 2011
Ruby Masters 2011
Site speed Server Optimization
Site speed Server Optimization
面向测试的前端知识
面向测试的前端知识
Más de Simon Courtois
Conseils pour un lancement Product Hunt réussi
Conseils pour un lancement Product Hunt réussi
Simon Courtois
Organize your assets with Rails
Organize your assets with Rails
Simon Courtois
Speed your Rails app creation with templates
Speed your Rails app creation with templates
Simon Courtois
Dependency sorting in Ruby with TSort
Dependency sorting in Ruby with TSort
Simon Courtois
How Unidecoder Transliterates UTF-8 to ASCII
How Unidecoder Transliterates UTF-8 to ASCII
Simon Courtois
Multi tenant/lang application with Ruby on Rails
Multi tenant/lang application with Ruby on Rails
Simon Courtois
Fake your files - MemFs
Fake your files - MemFs
Simon Courtois
Rails is like Burger King
Rails is like Burger King
Simon Courtois
REST with Her (and let Her take care of the REST)
REST with Her (and let Her take care of the REST)
Simon Courtois
Ruby and DCI
Ruby and DCI
Simon Courtois
Cells
Cells
Simon Courtois
Mustdown
Mustdown
Simon Courtois
Vos Regexps sont fausses !
Vos Regexps sont fausses !
Simon Courtois
Ariane
Ariane
Simon Courtois
Pourquoi Ruby on Rails ça déchire ?
Pourquoi Ruby on Rails ça déchire ?
Simon Courtois
Commander
Commander
Simon Courtois
Más de Simon Courtois
(16)
Conseils pour un lancement Product Hunt réussi
Conseils pour un lancement Product Hunt réussi
Organize your assets with Rails
Organize your assets with Rails
Speed your Rails app creation with templates
Speed your Rails app creation with templates
Dependency sorting in Ruby with TSort
Dependency sorting in Ruby with TSort
How Unidecoder Transliterates UTF-8 to ASCII
How Unidecoder Transliterates UTF-8 to ASCII
Multi tenant/lang application with Ruby on Rails
Multi tenant/lang application with Ruby on Rails
Fake your files - MemFs
Fake your files - MemFs
Rails is like Burger King
Rails is like Burger King
REST with Her (and let Her take care of the REST)
REST with Her (and let Her take care of the REST)
Ruby and DCI
Ruby and DCI
Cells
Cells
Mustdown
Mustdown
Vos Regexps sont fausses !
Vos Regexps sont fausses !
Ariane
Ariane
Pourquoi Ruby on Rails ça déchire ?
Pourquoi Ruby on Rails ça déchire ?
Commander
Commander
Último
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
HimanshiGarg82
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
masabamasaba
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
Shane Coughlan
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
AmarnathKambale
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
Papp Krisztián
tonesoftg
tonesoftg
lanshi9
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
masabamasaba
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
masabamasaba
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
SelfMade bd
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
masabamasaba
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Steffen Staab
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
Juha-Pekka Tolvanen
Direct Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension Aid
Philip Schwarz
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
Último
(20)
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
tonesoftg
tonesoftg
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
Direct Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension Aid
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Get Slim!
1.
Simon Courtois -
@happynoff Get Slim!
2.
Two Default Rails
Stacks http://words.steveklabnik.com/rails-has-two-default-stacks • Views: ERB • DB: MySQL • Tests: MiniTest • Fat Models / Skinny Controllers • Views: Haml • DB: PostgreSQL • Tests: RSpec • Skinny Models / Skinny Controllers / Service Layer
3.
Two Default Rails
Stacks http://words.steveklabnik.com/rails-has-two-default-stacks • Views: ERB! • DB: MySQL • Tests: MiniTest • Fat Models / Skinny Controllers • Views: Haml! • DB: PostgreSQL • Tests: RSpec • Skinny Models / Skinny Controllers / Service Layer
4.
ERB Haml <!DOCTYPE html> <html> <head> <title>Hello</title> </head> ! <body> <div
id=“main” class=“content”> <%= yield %> </div> </body> </html> !!! 5 %html %head %title Hello ! %body #main.content = yield
5.
But there is
another cool one! Slim
6.
ERB Slim doctype html html head title
Hello ! body #main.content = yield <!DOCTYPE html> <html> <head> <title>Hello</title> </head> ! <body> <div id=“main” class=“content”> <%= yield %> </div> </body> </html>
7.
What’s the difference
?
8.
First things first… no
fucking % (haters gonna hate)
9.
What about attributes? ERB Slim <a
href=“rubyparis.org” title=“Paris.rb”>ParisRB</a> a href=“rubyparis.org” title=“Paris.rb” ParisRB Haml %a{href=“rubyparis.org” title=“Paris.rb”} ParisRB
10.
Ok but why
bother?
11.
Speed!
12.
Secondstoreach10000iterations 0 0,4 0,8 1,2 1,6 1st run 2nd
run ERB Haml Slim https://travis-ci.org/slim-template/slim/jobs/26437512
13.
What’s the trick
then?
14.
Spaces handling %span Hello %span
Paris.rbHaml Slim span Hello span Paris.rb Hello Paris.rb HelloParis.rb
15.
Spaces handling Haml conserves
spaces by default Slim spaces are opt-in
16.
Spaces handling %span> Hello %span
Paris.rbHaml Slim span Hello span Paris.rb HelloParis.rb HelloParis.rb
17.
Spaces handling %span Hello %span
Paris.rbHaml Slim span> Hello span Paris.rb Hello Paris.rb Hello Paris.rb
18.
Wanna nest things? ul:
li.active: a href=“rubyparis.org” Paris.rb Go ahead!
19.
One more thing
20.
Like it logic-less? -
articles p.title = title .content = body ! -! articles p No articles yet!
21.
Get it on http://slim-lang.com/
22.
Questions ?
23.
Thank you Simon Courtois
- @happynoff
Descargar ahora