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
150
Git tips
roman_dubrovsky
0
60
Cells refactroing
roman_dubrovsky
0
40
Other Decks in Programming
See All in Programming
業務でAIを使いたい話
hnw
0
220
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
1k
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
3
5.3k
CSC305 Lecture 13
javiergs
PRO
0
340
Developer Joy - The New Paradigm
hollycummins
1
400
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
10
2k
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
17k
GC25 Recap: The Code You Reviewed is Not the Code You Built / #newt_gophercon_tour
mazrean
0
140
Node-REDのノードの開発・活用事例とコミュニティとの関わり(Node-RED Con Nagoya 2025)
404background
0
110
スキーマ駆動で、Zod OpenAPI Honoによる、API開発するために、Hono Takibiというライブラリを作っている
nakita628
0
330
Pythonに漸進的に型をつける
nealle
1
150
GitHub Copilotを使いこなせ!/mastering_github_copilot!
kotakageyama
2
640
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
700
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
For a Future-Friendly Web
brad_frost
180
10k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Site-Speed That Sticks
csswizardry
13
940
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.7k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Navigating Team Friction
lara
190
15k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
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
ПОТРАЧЕНО