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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
61
GraphQl paratemers (lightning)
roman_dubrovsky
0
18
Views and Controllers, Forms
roman_dubrovsky
0
23
Railway Oriented Programming
roman_dubrovsky
0
160
Git tips
roman_dubrovsky
0
63
Cells refactroing
roman_dubrovsky
0
41
Other Decks in Programming
See All in Programming
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
180
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
100
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
420
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
350
Codex の「自走力」を高める
yorifuji
0
1.3k
Feature Toggle は捨てやすく使おう
gennei
0
390
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
OTP を自動で入力する裏技
megabitsenmzq
0
130
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
6
1.1k
The free-lunch guide to idea circularity
hollycummins
0
390
Ruby and LLM Ecosystem 2nd
koic
1
1.4k
Rethinking API Platform Filters
vinceamstoutz
0
4.2k
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
300
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Technical Leadership for Architectural Decision Making
baasie
3
300
Done Done
chrislema
186
16k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
460
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Visualization
eitanlees
150
17k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
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
ПОТРАЧЕНО