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
81
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
340
Refactoring Trust on Your Team (CTO Summit 2018)
rmw
1
1.5k
Trust and Teams: GORUCO 2017
rmw
0
280
Becoming an Engineer Leader Panel Intro Slide
rmw
0
350
Frameworks for Feedback (Long version) - 2016 May Self Conference
rmw
2
1k
Frameworks for Feedback (2015 May - RailsConf)
rmw
1
540
Frameworks for Feedback - DevOpsDays Chicago
rmw
0
970
Tech Talk 101: Topic Generation
rmw
0
430
Other Decks in Programming
See All in Programming
Claude Codeログ基盤の構築
giginet
PRO
7
3.8k
飯MCP
yusukebe
0
410
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
100
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
280
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
220
おれのAgentic Coding 2026/03
tsukasagr
1
120
ロボットのための工場に灯りは要らない
watany
12
3.2k
Coding as Prompting Since 2025
ragingwind
0
390
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
200
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
110
Feature Toggle は捨てやすく使おう
gennei
0
390
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
290
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1032
470k
4 Signs Your Business is Dying
shpigford
187
22k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
Embracing the Ebb and Flow
colly
88
5k
Documentation Writing (for coders)
carmenintech
77
5.3k
A Soul's Torment
seathinner
5
2.6k
Designing for Performance
lara
611
70k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
780
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
240
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
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