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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
murajun1978
December 20, 2014
Programming
1
170
shinosakarb #11 Rails 4 Pattenrs
murajun1978
December 20, 2014
Tweet
Share
More Decks by murajun1978
See All by murajun1978
変化を楽しむエンジニアリング ~ いままでとこれから ~
murajun1978
0
1.1k
How to Enjoy the Murajun’s Style
murajun1978
0
89
Building Tebukuro with Hotwire and Rails
murajun1978
0
1.5k
Zeitwerk integration in Rails 6.0
murajun1978
0
130
Efficient development with GraphQL
murajun1978
0
320
Effective Debugging Apps in VS Code
murajun1978
1
960
tebukuro
murajun1978
0
130
Shinosaka.rb #17 Hands on
murajun1978
0
66
New Features in Rails 4.2
murajun1978
0
950
Other Decks in Programming
See All in Programming
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
160
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
380
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
190
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
260
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
210
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
210
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
440
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
780
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
170
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
330
AIプロダクト時代のQAエンジニアに求められること
imtnd
2
760
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜
kuro_kurorrr
3
1.8k
Featured
See All Featured
Navigating Team Friction
lara
192
16k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Un-Boring Meetings
codingconduct
0
220
Thoughts on Productivity
jonyablonski
75
5.1k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
380
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
53k
GraphQLの誤解/rethinking-graphql
sonatard
75
11k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Between Models and Reality
mayunak
2
230
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