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
110
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
180
Aplicaciones Web utilizando Ruby on Rails
edymerchk
0
33
Testing like gods
edymerchk
1
130
Other Decks in Programming
See All in Programming
Elm 0.19.0 Changes
bkuhlmann
0
490
Fast JSX: Don't clone props object #28768
yossydev
1
140
Site Reliability Engineering for GMO
pyama86
8
1.1k
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
280
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
950
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
260
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
1k
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
禅の心を手に入れよ
eltociear
1
180
VS Code をプロダクトにどう取り込むか
onomax
1
480
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
190
ゆるい個人開発のススメ
kuroppe1819
10
1k
Featured
See All Featured
Statistics for Hackers
jakevdp
789
220k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
244
20k
Designing for humans not robots
tammielis
248
25k
Adopting Sorbet at Scale
ufuk
68
8.6k
Making Projects Easy
brettharned
108
5.5k
Code Review Best Practice
trishagee
55
15k
The Invisible Customer
myddelton
114
12k
A Tale of Four Properties
chriscoyier
151
22k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
40
4.4k
[RailsConf 2023] Rails as a piece of cake
palkan
23
4k
The Illustrated Children's Guide to Kubernetes
chrisshort
31
46k
Making the Leap to Tech Lead
cromwellryan
124
8.5k
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!!