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
20
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
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
720
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
Android端末で実現するオンデバイスLLM 2025
masayukisuda
1
120
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
21
5.6k
AI時代のUIはどこへ行く?
yusukebe
17
8.8k
私の後悔をAWS DMSで解決した話
hiramax
4
210
ユーザーも開発者も悩ませない TV アプリ開発 ~Compose の内部実装から学ぶフォーカス制御~
taked137
0
140
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
120
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.2k
MCPで実現するAIエージェント駆動のNext.jsアプリデバッグ手法
nyatinte
7
1.1k
テストコードはもう書かない:JetBrains AI Assistantに委ねる非同期処理のテスト自動設計・生成
makun
0
250
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
2k
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
96
6.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Automating Front-end Workflow
addyosmani
1370
200k
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Thoughts on Productivity
jonyablonski
70
4.8k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
Six Lessons from altMBA
skipperchong
28
4k
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
ПОТРАЧЕНО