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
86
0
Share
HowAboutWe for Couples Views & Styles Patterns
in Rails
Rebecca Miller-Webster
March 27, 2013
More Decks by Rebecca Miller-Webster
See All by Rebecca Miller-Webster
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Trust & Teams: 2019 Chicago CTO Summit
rmw
2
360
Refactoring Trust on Your Team (CTO Summit 2018)
rmw
1
1.5k
Trust and Teams: GORUCO 2017
rmw
0
290
Becoming an Engineer Leader Panel Intro Slide
rmw
0
360
Frameworks for Feedback (Long version) - 2016 May Self Conference
rmw
2
1k
Frameworks for Feedback (2015 May - RailsConf)
rmw
1
550
Frameworks for Feedback - DevOpsDays Chicago
rmw
0
980
Tech Talk 101: Topic Generation
rmw
0
440
Other Decks in Programming
See All in Programming
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
1
190
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
220
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
460
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
670
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
460
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
140
要はバランスからの卒業 #yumemi_grow
kajitack
0
170
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
0
230
GoogleCloudとterraform完全に理解した
terisuke
1
200
cloudnative conference 2026 flyle
azihsoyn
1
190
Back to the roots of date
jinroq
0
880
Agentic Elixir
whatyouhide
0
450
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
200
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
380
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
180
We Have a Design System, Now What?
morganepeng
55
8.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
180
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
340
Embracing the Ebb and Flow
colly
88
5k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
140
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