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
Clean Up Your Views
Search
Luis Edimerchk Laverde
September 20, 2016
Programming
0
120
Clean Up Your Views
Slides for my talk in Medellin.rb
Luis Edimerchk Laverde
September 20, 2016
Tweet
Share
More Decks by Luis Edimerchk Laverde
See All by Luis Edimerchk Laverde
Refactoring a Rails API
edymerchk
0
210
Aplicaciones Web utilizando Ruby on Rails
edymerchk
0
53
Testing like gods
edymerchk
1
130
Other Decks in Programming
See All in Programming
AkarengaLT vol.38
hashimoto_kei
1
120
スキーマ駆動で、Zod OpenAPI Honoによる、API開発するために、Hono Takibiというライブラリを作っている
nakita628
0
320
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
330
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
9
1.5k
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
650
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
460
なんでRustの環境構築してないのにRust製のツールが動くの? / Why Do Rust-Based Tools Run Without a Rust Environment?
ssssota
14
46k
マンガアプリViewerの大画面対応を考える
kk__777
0
240
ALL CODE BASE ARE BELONG TO STUDY
uzulla
27
6.7k
Go言語はstack overflowの夢を見るか?
logica0419
0
530
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
3
960
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
800
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
8
300
Six Lessons from altMBA
skipperchong
29
4k
A Modern Web Designer's Workflow
chriscoyier
697
190k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
890
How to train your dragon (web standard)
notwaldorf
97
6.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
190
55k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Transcript
CLEAN UP YOUR VIEWS @edymerchk
LUIS EDYMERCHK LAVERDE
None
None
BUT…
rails-api
RAILS VIEWS
None
EXAMPLE 1. Reviewed at : August 18, 2016 2. Reviewed
at : No Reviewed yet
None
HELPERS TO THE RESCUE
None
HELPERS… ➤ Global Namespace ➤ Object-disoriented functions ➤ Helpers are
modules ➤ Called without an obvious receiver
Helpers
MODEL METHODS TO THE RESCUE
None
DESIGNS PATTERNS
“ Design pattern is a general reusable solution to a
commonly occurring problem within a given context
Module Mediator Facade Factory Chain Memento Visitor Abstract Broker Builder
Iterator Proxy Decorator Strategy Prototype Observer Template Active Record Composite Command Data transfer object MVC Singleton Reactor GRASP
DECORATOR
“ The decorator is a design pattern that allows behavior
to be added to an individual object, either statically or dynamically,Type a quote here. -wikipedia
DECORATOR IN RAILS
“ mkdir app/decorators touch app/decorators/object_decorator.rb
None
None
None
None
BENEFITS ➤ Flexibility ➤ Organization & Readability ➤ Testing!!! ➤
Open Close Principle ➤ Split logic
DRAPER
THANKS!!