Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
shinosakarb #11 Rails 4 Pattenrs
murajun1978
December 20, 2014
Programming
1
80
shinosakarb #11 Rails 4 Pattenrs
murajun1978
December 20, 2014
Tweet
Share
More Decks by murajun1978
See All by murajun1978
murajun1978
0
64
murajun1978
0
97
murajun1978
1
590
murajun1978
0
75
murajun1978
0
32
murajun1978
0
750
murajun1978
1
42
murajun1978
0
24
murajun1978
0
23
Other Decks in Programming
See All in Programming
dnskimo
8
1.5k
takanorihara
0
250
fadis
3
1.8k
n1215
1
430
joytomo
1
520
nori0__
1
480
emberconf
0
130
deepu105
1
180
pandanoir
0
270
andrewgodwin
1
150
bkuhlmann
4
290
drumato
1
220
Featured
See All Featured
sugarenia
233
880k
marcelosomers
221
15k
morganepeng
19
1.3k
mza
80
4.2k
wjessup
340
16k
philhawksworth
190
17k
chrislema
231
16k
rocio
155
11k
ddemaree
273
31k
shpigford
370
42k
denniskardys
220
120k
keavy
107
14k
Transcript
Rails 4 Patterns Shinosaka.rb #11
me @murajun1978
Rails 4.2.0 has been released!
new goodies ActionMailer #deliver_later Active Job Web Console Good! Adequate
Record
Agenda • ActiveRecord::Callbacks • Scope • ActiveSupport::Concern • Decorator •
ActiveDecorator vs Draper • Helper
Fat Controller
Fat Controller
ActiveRecord::Callbacks
Scope NoMethodError!!
Scope
Scope
Fat Model
ActiveSupport::Concern app/models/concerns/… Class method duplicate :(
Decorator ActiveDecorator view logic… :( $ rails g decorator Post
app/decorators/…
Decorator Which do you like? ActiveDecorator Draper https://github.com/drapergem/draper https://github.com/amatsuda/active_decorator
Helper content_tag_for <tr id="post_123" class=“post ..”>…</tr> http://localhost/posts#post_123