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
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
31
Feature toggling
roman_dubrovsky
0
56
GraphQl paratemers (lightning)
roman_dubrovsky
0
15
Views and Controllers, Forms
roman_dubrovsky
0
19
Railway Oriented Programming
roman_dubrovsky
0
130
Git tips
roman_dubrovsky
0
58
Cells refactroing
roman_dubrovsky
0
37
Other Decks in Programming
See All in Programming
VS Code Update for GitHub Copilot
74th
1
480
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
270
NPOでのDevinの活用
codeforeveryone
0
470
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
180
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
240
Result型で“失敗”を型にするPHPコードの書き方
kajitack
4
540
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
120
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
4
1k
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
320
エンジニア向け採用ピッチ資料
inusan
0
170
ReadMoreTextView
fornewid
1
490
Bytecode Manipulation 으로 생산성 높이기
bigstark
2
390
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
A Tale of Four Properties
chriscoyier
160
23k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
The Invisible Side of Design
smashingmag
300
51k
Faster Mobile Websites
deanohume
307
31k
Unsuck your backbone
ammeep
671
58k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
680
The World Runs on Bad Software
bkeepers
PRO
69
11k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
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
ПОТРАЧЕНО