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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Jesse Wolgamott
October 10, 2012
Technology
190
1
Share
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
210
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
データ基盤構築・運用の現場から 〜 Snowflake Intelligence 導入で変わった、データ活用の未来 〜
wonohe
0
190
情シスがMCP環境導入時に打ちのめされる認可の崖
oidfj
0
520
Splunk MCPサーバの利活用事例 ーKINTOテクノロジーズの取り組み
kintotechdev
1
340
AI活用の格差をなくす:チーム全体のAI開発生産性を底上げする方法
moongift
PRO
1
110
AIが変えた"品質の守り方"
kkakizaki
12
4.5k
AI駆動開発でなんでもハンズオン環境をつくってみた
yoshimi0227
0
150
NFLコンペ2026 解法
lycorptech_jp
PRO
0
120
TSKaigi 2026 - enumよ、さようなら
teamlab
PRO
3
560
20260528_生成AIを専属DSに_Howの次にすべきことを考える
doradora09
PRO
0
210
その英語学習、AWSで代替できませんか?
suzutatsu
1
260
論文紹介:Pixal3D (SIGGRAPH 2026)
tenten0727
0
750
ルール・ロール・ツールを創る / Creating Rules, Roles and Tools
ks91
PRO
0
170
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
580
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
Navigating Team Friction
lara
192
16k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.3k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
360
Mind Mapping
helmedeiros
PRO
1
210
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
270
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
750
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
180
Marketing to machines
jonoalderson
1
5.3k
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