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
Rails Essentials: simple_form
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Jesse Wolgamott
October 10, 2012
Technology
190
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rails Essentials: simple_form
Houston Ruby Brigade appetizer to simple_form (rails form DSL)
Jesse Wolgamott
October 10, 2012
More Decks by Jesse Wolgamott
See All by Jesse Wolgamott
React vs React-Native
jwo
0
150
What is an API
jwo
0
220
DIY Rails Authentication
jwo
0
240
ActionCable - For Not Another Chat App
jwo
3
1.8k
SlackBot.rb - Create You a Slack Bot
jwo
1
1.5k
react-rails: an isomorphic match made in heaven
jwo
0
1.4k
Docker - next big thing
jwo
0
1k
Ruby 2.1 Overview
jwo
0
1.1k
Rails 4: Appetizers
jwo
1
1.1k
Other Decks in Technology
See All in Technology
あなたの『Site』はどこですか? — xREという考え方
miyamu
0
1.2k
AIコード生成×サプライチェーン攻撃 — PHPが直面する“二重の信頼問題
shinyasaita
0
190
ボーイスカウトルールでメモリやスキルを改善しよう
azukiazusa1
4
1.4k
第67回コンピュータビジョン勉強会CVPR2026読会前編
tsukamotokenji
0
140
SRE依存からの脱却 運用を開 発チームへ移す、 フルサイ クル開 発体制の実践
joooee0000
0
3.1k
LLMやAIエージェントをソフトウェアに組み込むプラクティス
shibuiwilliam
2
420
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.4k
ヘルスケア領域における AI 活用と その安全性担保のための取り組み (Leveraging AI in Healthcare and Our Efforts to Ensure Its Safety) - Google I/O Extended Tokyo 2026, July 11, 2026
zettaittenani
0
420
ガバナンスの「ちょうどいい落とし所」を探れ!開発スピードを妨げない運用判断の勘所 / SRE NEXT 2026
genda
1
240
CDKで書くECSのベストプラクティス、 改めて考え直す2026 #cdkconf2026
makies
3
760
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
0
260
Genie Ontologyは銀の弾丸かを考える / Is Genie Ontology a Silver Bullet?
nttcom
0
390
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
880
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
470
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Making Projects Easy
brettharned
120
6.7k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
370
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Transcript
SIMPLE FORM Rails Essentials: @jwo
gem “simple_form” bundle rails g simple_form:install By Platformatec (same cats
as Devise)
rails g scaffold post title body publish_on:date featured:boolean Why is
this needed? <%= simple_form_for(@post) do |f| %> <%= f.error_notification %> <div class="form-inputs"> <%= f.input :title %> <%= f.input :body %> <%= f.input :publish_on %> <%= f.input :featured %> </div> <div class="form-actions"> <%= f.button :submit %> </div> <% end %>
As Compared to <%= form_for(@post) do |f| %> <% if
@post.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2> <ul> <% @post.errors.full_messages.each do |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :title %><br /> <%= f.text_field :title %> </div> <div class="field"> <%= f.label :body %><br /> <%= f.text_field :body %> </div> <div class="field"> <%= f.label :publish_on %><br /> <%= f.date_select :publish_on %> </div> <div class="field"> <%= f.label :featured %><br /> <%= f.check_box :featured %> </div> <div class="actions"> <%= f.submit %> </div> <% end %>
Let’s see that again <%= simple_form_for(@post) do |f| %> <%=
f.error_notification %> <div class="form-inputs"> <%= f.input :title %> <%= f.input :body %> <%= f.input :publish_on %> <%= f.input :featured %> </div> <div class="form-actions"> <%= f.button :submit %> </div> <% end %>
It’s Just a Wrapper All form_helpers in Rails apply select,
collection_select, date_select You can pass to the HTML of the form or the input
Why over Formtastic? Formtastic had a strong opinion on form
markup created You can define what markup to use with your CSS Twitter Bootstrap, Zurb Foundation, ALL CAN BE YOURS
GUESS WHAT
Associations has many throughs are now SIMPLE. f.association :categories, as:
:check_boxes
Bootstrap Integration Yes, it does this nicely And there’s a
bootstrap picker. demo (github.com/houstonruby/rails_essentials/simple_form