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
can-form
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Mihael Konjević
July 11, 2014
Programming
570
1
Share
can-form
Presentation of the can-form plugin -
https://github.com/retro/can-form
Mihael Konjević
July 11, 2014
More Decks by Mihael Konjević
See All by Mihael Konjević
Developing (with) Keechma
retro
1
280
File uploading with can.Component and jQuery-file-upload
retro
0
660
JSON Schema and APItizer
retro
2
280
Event Oriented Architecture and Client side apps
retro
2
610
Other Decks in Programming
See All in Programming
ファインチューニングせずメインコンペを解く方法
pokutuna
0
270
20260315 AWSなんもわからん🥲
chiilog
2
190
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
520
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3k
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
210
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
140
見せてもらおうか、 OpenSearchの性能とやらを!
shunta27
1
180
Nuxt Server Components
wattanx
0
250
おれのAgentic Coding 2026/03
tsukasagr
1
130
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
710
Coding as Prompting Since 2025
ragingwind
0
740
Featured
See All Featured
Designing for humans not robots
tammielis
254
26k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
160
Joys of Absence: A Defence of Solitary Play
codingconduct
1
330
The Pragmatic Product Professional
lauravandoore
37
7.2k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
140
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Everyday Curiosity
cassininazir
0
190
Transcript
can-form Awesome forms for CanJS
Why? • validations and error reporting is a pain •
similar code written over and over again • how do you handle nested object structures?
can-form • can-value is great, use it • behaves like
the can.Component • composable / nestable (allows it to handle nested structures) • validations on the form (validations are bound to context) • simple error reporting and tracking
API FormComponent.extend({ tag : 'simple-form', template : '<content><content>', validate :
{ username : [FormComponent.validationRules.presenceOf()], password : [FormComponent.validationRules.presenceOf()] } }); <simple-form map="{userModel}"> <input type="text" can-value="username"> {{#errors 'username'}} <ul class="bg-danger list-unstyled"> {{#this}} <li>{{ . }}</li> {{/this}} </ul> {{/errors}} <input type="text" can-value="password"> {{#errors 'password'}} <ul class="bg-danger list-unstyled"> {{#this}} <li>{{ . }}</li> {{/this}} </ul> {{/errors}} <button>Submit</button> </simple-form>
API FormComponent.extend({ tag : 'simple-form', template : '<content><content>', validate :
{ username : [FormComponent.validationRules.presenceOf()], password : [FormComponent.validationRules.presenceOf()], 'socialNetworks.*.username' : [FormComponent.validationRules.presenceOf()], 'socialNetworks.*.network' : [FormComponent.validationRules.presenceOf()] } });
API <simple-form map="{userModel}"> <input type="text" can-value="username"> {{#errors 'username'}} <ul class="bg-danger
list-unstyled"> {{#this}} <li>{{ . }}</li> {{/this}} </ul> {{/errors}} … ! {{#each socialNetworks}} <form-for map="{this}" path="socialNetworks.{{@index}}"> <input type="text" can-value="network"> // error reporting code here <input type="text" can-value="username"> // error reporting code here </form-for> {{/each}} <button>Submit</button> </simple-form>
API FormComponent.extend({ tag : 'social-network', template : socialNetworkTemplate, validate :
{ username : [FormComponent.validationRules.presenceOf()], network : [FormComponent.validationRules.presenceOf()] } })
API <simple-form map="{userModel}"> <input type="text" can-value="username"> {{#errors 'username'}} <ul class="bg-danger
list-unstyled"> {{#this}} <li>{{ . }}</li> {{/this}} </ul> {{/errors}} ! … ! {{#each socialNetworks}} <social-network map="{this}" path="socialNetworks.{{@index}}"> </social-network> {{/each}} ! <button>Submit</button> </simple-form>
github.com/retro/can-form @mihaelkonjevic