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
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
140
Git tips
roman_dubrovsky
0
60
Cells refactroing
roman_dubrovsky
0
39
Other Decks in Programming
See All in Programming
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
990
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
240
オープンソースソフトウェアへの解像度🔬
utam0k
12
2.5k
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
2
170
Conquering Massive Traffic Spikes in Ruby Applications with Pitchfork
riseshia
0
160
開発生産性を上げるための生成AI活用術
starfish719
3
430
All About Angular's New Signal Forms
manfredsteyer
PRO
0
110
Your Perfect Project Setup for Angular @BASTA! 2025 in Mainz
manfredsteyer
PRO
0
160
高度なUI/UXこそHotwireで作ろう Kaigi on Rails 2025
naofumi
4
3.9k
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
0
220
止められない医療アプリ、そっと Swift 6 へ
medley
1
150
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
100
Featured
See All Featured
Practical Orchestrator
shlominoach
190
11k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Designing for Performance
lara
610
69k
RailsConf 2023
tenderlove
30
1.2k
Producing Creativity
orderedlist
PRO
347
40k
4 Signs Your Business is Dying
shpigford
185
22k
Navigating Team Friction
lara
189
15k
Side Projects
sachag
455
43k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
Six Lessons from altMBA
skipperchong
28
4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
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
ПОТРАЧЕНО