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

Cleaning up your views

Cleaning up your views

A9a491b0fcbe0fbce3d64063a37add99?s=128

Rebecca Miller-Webster

April 03, 2013
Tweet

Transcript

  1. Cleaning up views with Decorators & Helpers Rebecca Miller-Webster

  2. None
  3. None
  4. • logic in views is harder to test • views

    are difficult to reason about Problem: Our Views are messy WTF is happening here??
  5. Decorators & Helpers WHEN SHIT GETS COMPLICATED

  6. Decorators Logic moves with the OBJECT Helpers Logic moves with

    the VIEW
  7. This

  8. TO

  9. How?

  10. Generate classes

  11. None
  12. Generate Copy

  13. Encapsulate repetition in partials Sometimes zero Sometimes one Sometimes two

  14. None
  15. Generate html attributes From TO WITH

  16. Thank you!