Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Form objects
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Roman Dubrovsky
June 16, 2016
Programming
180
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Form objects
Roman Dubrovsky
June 16, 2016
Transcript
37 slides
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
ПОТРАЧЕНО
More Decks by Roman Dubrovsky
See All by Roman Dubrovsky
Life with GraphQL
roman_dubrovsky
0
170
Timezone pain (lighting)
roman_dubrovsky
0
41
Feature toggling
roman_dubrovsky
0
79
GraphQl paratemers (lightning)
roman_dubrovsky
0
25
Views and Controllers, Forms
roman_dubrovsky
0
30
Railway Oriented Programming
roman_dubrovsky
0
180
Git tips
roman_dubrovsky
0
74
Cells refactroing
roman_dubrovsky
0
49
Other Decks in Programming
See All in Programming
RaspberryPi 5で軽くはじめるk3sとtailscaleを用いたホームサーバー構築 (1)
nasum
0
440
Spec-driven Development with AI
simas
PRO
0
2.3k
SODA - FACT BOOK(JP)
sodainc
1
40k
Stage 3でも仕様は変わる。アプリケーション開発者のためのTC39プロセスの読み方
bicstone
1
240
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
700
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
270
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
400
はじめてのPLATEAU
nokonoko1203
1
670
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
1
250
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
170
エラーチャンネルのボールを拾い続けて鍛えるエンジニアの地力 / phpcon-niigata2026
meihei3
1
500
Featured
See All Featured
Building the Perfect Custom Keyboard
takai
2
970
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1.1k
Product Roadmaps are Hard
iamctodd
55
13k
Faster Mobile Websites
deanohume
310
32k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
Google's AI Overviews - The New Search
badams
0
1.7k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
620
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
320
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.3k