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
150
shinosakarb #11 Rails 4 Pattenrs
murajun1978
December 20, 2014
Tweet
Share
More Decks by murajun1978
See All by murajun1978
変化を楽しむエンジニアリング ~ いままでとこれから ~
murajun1978
0
140
How to Enjoy the Murajun’s Style
murajun1978
0
56
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
910
tebukuro
murajun1978
0
120
Shinosaka.rb #17 Hands on
murajun1978
0
53
New Features in Rails 4.2
murajun1978
0
920
Other Decks in Programming
See All in Programming
QA x AIエコシステム段階構築作戦
osu
0
150
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
470
Yes, You Can Work on Rails & any other Gem
kaspth
0
110
ZeroETLで始めるDynamoDBとS3の連携
afooooil
0
120
顧客の画像データをテラバイト単位で配信する 画像サーバを WebP にした際に起こった課題と その対応策 ~継続的な取り組みを添えて~
takutakahashi
4
1.4k
DMMを支える決済基盤の技術的負債にどう立ち向かうか / Addressing Technical Debt in Payment Infrastructure
yoshiyoshifujii
4
600
状態遷移図を書こう / Sequence Chart vs State Diagram
orgachem
PRO
3
260
Jakarta EE Meets AI
ivargrimstad
0
280
バイブコーディング超えてバイブデプロイ〜CloudflareMCPで実現する、未来のアプリケーションデリバリー〜
azukiazusa1
2
710
SQLアンチパターン第2版 データベースプログラミングで陥りがちな失敗とその対策 / Intro to SQL Antipatterns 2nd
twada
PRO
27
8.1k
「App Intent」よくわからんけどすごい!
rinngo0302
1
130
Gemini CLI のはじめ方
ttnyt8701
1
100
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Writing Fast Ruby
sferik
628
62k
A designer walks into a library…
pauljervisheath
207
24k
Code Review Best Practice
trishagee
69
19k
Speed Design
sergeychernyshev
32
1k
The Pragmatic Product Professional
lauravandoore
35
6.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Building Adaptive Systems
keathley
43
2.7k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
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