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
130
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
1.2k
Zeitwerk integration in Rails 6.0
murajun1978
0
110
Efficient development with GraphQL
murajun1978
0
290
Effective Debugging Apps in VS Code
murajun1978
1
880
tebukuro
murajun1978
0
110
Shinosaka.rb #17 Hands on
murajun1978
0
46
New Features in Rails 4.2
murajun1978
0
910
FactoryGirl LT
murajun1978
1
68
Shinosaka.rb #3
murajun1978
0
52
Other Decks in Programming
See All in Programming
ML.NETで始める機械学習
ymd65536
0
250
ABEMA iOS 大規模プロジェクトにおける段階的な技術刷新 / ABEMA iOS Technology Upgrade
akkyie
1
250
もう僕は OpenAPI を書きたくない
sgash708
6
1.9k
Introduction to C Extensions
sylph01
3
120
オレを救った Cline を紹介する
codehex
15
14k
Amazon Bedrockマルチエージェントコラボレーションを諦めてLangGraphに入門してみた
akihisaikeda
1
160
バッチを作らなきゃとなったときに考えること
irof
2
560
楽しく向き合う例外対応
okutsu
0
740
Google Cloudとo11yで実現するアプリケーション開発者主体のDB改善
nnaka2992
1
130
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
14
4.9k
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.6k
Jakarta EE meets AI
ivargrimstad
0
680
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Designing for Performance
lara
605
68k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
Into the Great Unknown - MozCon
thekraken
35
1.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Building an army of robots
kneath
303
45k
Visualization
eitanlees
146
15k
BBQ
matthewcrist
87
9.5k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
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