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
60
murajun1978
0
85
murajun1978
1
570
murajun1978
0
70
murajun1978
0
32
murajun1978
0
740
murajun1978
1
41
murajun1978
0
23
murajun1978
0
23
Other Decks in Programming
See All in Programming
akatsukinewgrad
0
130
horie1024
1
330
nrslib
20
13k
sullis
0
110
rshindo
2
290
bkuhlmann
4
610
junmikai
0
280
ippey
0
170
inoue2002
0
260
77web
4
1.4k
momofff
0
160
itosho525
0
340
Featured
See All Featured
revolveconf
200
9.6k
lemiorhan
626
42k
tanoku
258
24k
jakevdp
774
200k
holman
448
130k
holman
461
280k
myddelton
109
11k
scottboms
251
11k
chriscoyier
780
240k
rocio
155
11k
cromwellryan
101
5.9k
morganepeng
18
1.1k
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