Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
HowAboutWe for Couples Views & Styles Patterns
Search
Rebecca Miller-Webster
March 27, 2013
Programming
0
77
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.3k
Trust & Teams: 2019 Chicago CTO Summit
rmw
2
320
Refactoring Trust on Your Team (CTO Summit 2018)
rmw
1
1.4k
Trust and Teams: GORUCO 2017
rmw
0
250
Becoming an Engineer Leader Panel Intro Slide
rmw
0
320
Frameworks for Feedback (Long version) - 2016 May Self Conference
rmw
2
960
Frameworks for Feedback (2015 May - RailsConf)
rmw
1
520
Frameworks for Feedback - DevOpsDays Chicago
rmw
0
930
Tech Talk 101: Topic Generation
rmw
0
400
Other Decks in Programming
See All in Programming
ローターアクトEクラブ アメリカンナイト:川端 柚菜 氏(Japan O.K. ローターアクトEクラブ 会長):2720 Japan O.K. ロータリーEクラブ2025年12月1日卓話
2720japanoke
0
730
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
510
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
140
JETLS.jl ─ A New Language Server for Julia
abap34
1
400
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
0
220
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
110
TestingOsaka6_Ozono
o3
0
160
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
130
chocoZAPサービス予約システムをNuxtで内製化した話
rizap_tech
0
130
Cap'n Webについて
yusukebe
0
130
20 years of Symfony, what's next?
fabpot
2
360
ZOZOにおけるAI活用の現在 ~モバイルアプリ開発でのAI活用状況と事例~
zozotech
PRO
9
5.7k
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Raft: Consensus for Rubyists
vanstee
141
7.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
A Tale of Four Properties
chriscoyier
162
23k
YesSQL, Process and Tooling at Scale
rocio
174
15k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Docker and Python
trallard
47
3.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Done Done
chrislema
186
16k
Typedesign – Prime Four
hannesfritz
42
2.9k
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