Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
HowAboutWe for Couples Views & Styles Patterns
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Rebecca Miller-Webster
March 27, 2013
Programming
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
HowAboutWe for Couples Views & Styles Patterns
in Rails
Rebecca Miller-Webster
March 27, 2013
Transcript
23 slides
Overview of Couples Views/Styles HowAboutWe Server 1 pointer March 26,
2013
• logic in views is harder to test • views
are difficult to reason about Problem: Our Views are messy WTF is happening here??
Fix #0: SASS and View Styleguide! https://github.com/howaboutwe/sass-style-guide
NOT DESIGN Markup is about content
None
Use SASS THE GOOD PARTS
None
Variables are your friend
Mixin it up ... WITH
Decorators & Helpers WHEN SHIT GETS COMPLICATED
Decorators Logic moves with the OBJECT Helpers Logic moves with
the VIEW
Move logic out of views When • if statements •
ternary • lots of states • It hurts my head Then Generate in (testable) code • Classes • Copy • Html attributes
This
TO
How?
Generate classes
Move classes up
None
Generate Copy
Encapsulate repetition in partials Sometimes zero Sometimes one Sometimes two
None
Generate html attributes From TO WITH
Our current pattern • Use & enforce styleguide for SASS
& views • Markup is about content not design • Use SASS ◦ variables ◦ mixins • Move classes up & design changes to CSS • Use decorators (or helpers) to: ◦ Generate classes ◦ Generate copy ◦ Generate HTML attributes
More Decks by Rebecca Miller-Webster
See All by Rebecca Miller-Webster
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Trust & Teams: 2019 Chicago CTO Summit
rmw
2
400
Refactoring Trust on Your Team (CTO Summit 2018)
rmw
1
1.6k
Trust and Teams: GORUCO 2017
rmw
0
340
Becoming an Engineer Leader Panel Intro Slide
rmw
0
400
Frameworks for Feedback (Long version) - 2016 May Self Conference
rmw
2
1.1k
Frameworks for Feedback (2015 May - RailsConf)
rmw
1
610
Frameworks for Feedback - DevOpsDays Chicago
rmw
0
1k
Tech Talk 101: Topic Generation
rmw
0
490
Other Decks in Programming
See All in Programming
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
350
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
300
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
200
imagewebp()の向こう側: WebPはなぜ JPEG・PNGより軽いのか
yuzneri
0
140
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
180
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
360
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
protojson における文字化けの扱い
kazuki1023
0
450
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
220
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
320
SODA - FACT BOOK(JP)
sodainc
1
40k
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
190
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
360
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
121
130k
It's Worth the Effort
3n
188
29k
Crafting Experiences
bethany
1
450
Statistics for Hackers
jakevdp
799
230k
Well, that’s weird…
csswizardry
1
180
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
570
Discover your Explorer Soul
emna__ayadi
2
1.3k
A Modern Web Designer's Workflow
chriscoyier
699
190k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
620