Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Form objects
Search
Roman Dubrovsky
June 16, 2016
Programming
1
170
Form objects
Roman Dubrovsky
June 16, 2016
Tweet
Share
More Decks by Roman Dubrovsky
See All by Roman Dubrovsky
Life with GraphQL
roman_dubrovsky
0
150
Timezone pain (lighting)
roman_dubrovsky
0
33
Feature toggling
roman_dubrovsky
0
58
GraphQl paratemers (lightning)
roman_dubrovsky
0
16
Views and Controllers, Forms
roman_dubrovsky
0
21
Railway Oriented Programming
roman_dubrovsky
0
150
Git tips
roman_dubrovsky
0
60
Cells refactroing
roman_dubrovsky
0
40
Other Decks in Programming
See All in Programming
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
140
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
140
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
5
2k
認証・認可の基本を学ぼう前編
kouyuume
0
190
手軽に積ん読を増やすには?/読みたい本と付き合うには?
o0h
PRO
1
170
dnx で実行できるコマンド、作ってみました
tomohisa
0
140
CSC305 Lecture 17
javiergs
PRO
0
340
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
380
Integrating WordPress and Symfony
alexandresalome
0
150
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.3k
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
430
Featured
See All Featured
A better future with KSS
kneath
240
18k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
It's Worth the Effort
3n
187
29k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
Git: the NoSQL Database
bkeepers
PRO
432
66k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Become a Pro
speakerdeck
PRO
31
5.7k
Music & Morning Musume
bryan
46
7k
For a Future-Friendly Web
brad_frost
180
10k
Transcript
Form Objects
None
User model
None
None
None
None
https://github.com/apotonick/reform
Defining form
Defining form Building form
Defining form Building form Using form
Defining form Building form Using form Using form
Form objects can: • Mapping attributes from models to form
• Define validations for form • Simple render form’s attributes
Form object is easy
1st case
1st case
Using form
Rendering form
accepts_nested_attributes_for:
2nd case accept_nested_attributes_for cocoon
Without form objects
None
With form objects
Move validations out of models
3rd case
None
With form object it’s easy
4th case
None
None
Using forms
Summary • Form objects can mapping attributes from models to
form • Form objects defining validations for form • Simple render form’s attributes with form objects • No validations in model
None
Pros • New abstraction • Clean models • No more
conditional validations • No more conditional params permissions
Cons • New abstraction • More code • Human factor
None
ПОТРАЧЕНО