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
shinosakarb #11 Rails 4 Pattenrs
Search
murajun1978
December 20, 2014
Programming
1
110
shinosakarb #11 Rails 4 Pattenrs
murajun1978
December 20, 2014
Tweet
Share
More Decks by murajun1978
See All by murajun1978
Building Tebukuro with Hotwire and Rails
murajun1978
0
960
Zeitwerk integration in Rails 6.0
murajun1978
0
100
Efficient development with GraphQL
murajun1978
0
260
Effective Debugging Apps in VS Code
murajun1978
1
840
tebukuro
murajun1978
0
100
Shinosaka.rb #17 Hands on
murajun1978
0
43
New Features in Rails 4.2
murajun1978
0
880
FactoryGirl LT
murajun1978
1
66
Shinosaka.rb #3
murajun1978
0
48
Other Decks in Programming
See All in Programming
CSC307 Lecture 07
javiergs
PRO
0
220
企業向け生成AIアプリの 開発から得られた知見
takaakikakei
0
310
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
2
81k
日付と正規化
megmogmog1965
0
140
はしめてのプログラミングとロボット制御
watawatavoltage
0
290
iOSアプリでクリップボードにコピーしたことをユーザーに伝えるちょうど良いフィードバックを探す
ski
0
100
MIERUNE BBQにおけるユーザー中心設計()
mierune
PRO
1
110
CSC307 Lecture 13
javiergs
PRO
0
150
最近追加した型の紹介とその振り返り
aki19035vc
0
180
【Go言語】golangci-lintの使い方
tomo1227
0
280
I/O Extended Android in Korea 2024 ~ Whats new in Android development tools
pluu
0
250
Clean Architecture by TypeScript & NestJS
ryounasso
0
150
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
121
18k
Leading Effective Engineering Teams 2024
addyosmani
3
300
Designing for humans not robots
tammielis
247
25k
Designing the Hi-DPI Web
ddemaree
276
34k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
17
1.5k
Side Projects
sachag
451
42k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
From Idea to $5000 a Month in 5 Months
shpigford
377
46k
Building Effective Engineering Teams - LeadDev
addyosmani
47
2.2k
Stop Working from a Prison Cell
hatefulcrawdad
266
20k
How to train your dragon (web standard)
notwaldorf
79
5.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
399
65k
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