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
49
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
300
Effective Debugging Apps in VS Code
murajun1978
1
900
tebukuro
murajun1978
0
120
Shinosaka.rb #17 Hands on
murajun1978
0
50
New Features in Rails 4.2
murajun1978
0
920
FactoryGirl LT
murajun1978
1
70
Other Decks in Programming
See All in Programming
CRUD から CQRS へ ~ 分離が可能にする柔軟性
tkawae
0
230
try-catchを使わないエラーハンドリング!? PHPでResult型の考え方を取り入れてみよう
kajitack
3
340
イベントストーミングから始めるドメイン駆動設計
jgeem
3
420
ワンバイナリWebサービスのススメ
mackee
10
7.5k
REST API設計の実践 – ベストプラクティスとその落とし穴
kentaroutakeda
2
320
TSConfigからTypeScriptの世界を覗く
planck16
2
1.3k
ソフトウェア品質特性、意識してますか?AIの真の力を引き出す活用事例 / ai-and-software-quality
minodriven
19
6.7k
コンポーネントライブラリで実現する、アクセシビリティの正しい実装パターン
schktjm
1
670
tsconfigのオプションで変わる型世界
keisukeikeda
1
130
從零到一:搭建你的第一個 Observability 平台
blueswen
0
220
『Python → TypeScript』オンボーディング奮闘記
takumi_tatsuno
1
140
Blueskyのプラグインを作ってみた
hakkadaikon
1
290
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
41
2.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.8k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
The Language of Interfaces
destraynor
158
25k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
Being A Developer After 40
akosma
91
590k
Code Reviewing Like a Champion
maltzj
523
40k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
Practical Orchestrator
shlominoach
188
11k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
460
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
Fontdeck: Realign not Redesign
paulrobertlloyd
84
5.5k
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