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
140
shinosakarb #11 Rails 4 Pattenrs
murajun1978
December 20, 2014
Tweet
Share
More Decks by murajun1978
See All by murajun1978
How to Enjoy the Murajun’s Style
murajun1978
0
53
Building Tebukuro with Hotwire and Rails
murajun1978
0
1.3k
Zeitwerk integration in Rails 6.0
murajun1978
0
110
Efficient development with GraphQL
murajun1978
0
310
Effective Debugging Apps in VS Code
murajun1978
1
900
tebukuro
murajun1978
0
120
Shinosaka.rb #17 Hands on
murajun1978
0
53
New Features in Rails 4.2
murajun1978
0
920
FactoryGirl LT
murajun1978
1
70
Other Decks in Programming
See All in Programming
TypeScript LSP の今までとこれから
quramy
1
490
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
130
CSC307 Lecture 17
javiergs
PRO
0
110
コード書くの好きな人向けAIコーディング活用tips #orestudy
77web
3
300
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
130
Rails産でないDBを Railsに引っ越すHACK - Omotesando.rb #110
lnit
1
160
Perlで痩せる
yuukis
1
680
JSAI2025 RecSysChallenge2024 優勝報告
unonao
1
450
Cursor AI Agentと伴走する アプリケーションの高速リプレイス
daisuketakeda
1
110
C++20 射影変換
faithandbrave
0
320
ReadMoreTextView
fornewid
1
350
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
760
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
43
2.4k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
How to train your dragon (web standard)
notwaldorf
92
6.1k
For a Future-Friendly Web
brad_frost
179
9.8k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
650
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
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