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
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
0
79
HowAboutWe for Couples Views & Styles Patterns
in Rails
Rebecca Miller-Webster
March 27, 2013
Tweet
Share
More Decks by Rebecca Miller-Webster
See All by Rebecca Miller-Webster
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Trust & Teams: 2019 Chicago CTO Summit
rmw
2
330
Refactoring Trust on Your Team (CTO Summit 2018)
rmw
1
1.5k
Trust and Teams: GORUCO 2017
rmw
0
270
Becoming an Engineer Leader Panel Intro Slide
rmw
0
330
Frameworks for Feedback (Long version) - 2016 May Self Conference
rmw
2
980
Frameworks for Feedback (2015 May - RailsConf)
rmw
1
530
Frameworks for Feedback - DevOpsDays Chicago
rmw
0
950
Tech Talk 101: Topic Generation
rmw
0
420
Other Decks in Programming
See All in Programming
CSC307 Lecture 02
javiergs
PRO
1
780
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
140
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
1
120
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
CSC307 Lecture 03
javiergs
PRO
1
490
生成AIを活用したソフトウェア開発ライフサイクル変革の現在値
hiroyukimori
PRO
0
100
Raku Raku Notion 20260128
hareyakayuruyaka
0
360
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
180
CSC307 Lecture 06
javiergs
PRO
0
690
要求定義・仕様記述・設計・検証の手引き - 理論から学ぶ明確で統一された成果物定義
orgachem
PRO
1
220
Data-Centric Kaggle
isax1015
2
780
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
310
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
21k
New Earth Scene 8
popppiees
1
1.5k
Producing Creativity
orderedlist
PRO
348
40k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
390
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
52
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
200
30 Presentation Tips
portentint
PRO
1
220
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
Prompt Engineering for Job Search
mfonobong
0
160
Building AI with AI
inesmontani
PRO
1
700
Transcript
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