Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HowAboutWe for Couples Views & Styles Patterns

HowAboutWe for Couples Views & Styles Patterns

in Rails

Rebecca Miller-Webster

March 27, 2013
Tweet

More Decks by Rebecca Miller-Webster

Other Decks in Programming

Transcript

  1. • logic in views is harder to test • views

    are difficult to reason about Problem: Our Views are messy WTF is happening here??
  2. 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
  3. TO

  4. 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