heartcombo/simple_form: a Rails form DSL that maps columns to inputs
Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup.
At a glance
- What is it?
- Simple Form is a Ruby gem that turns ActiveRecord column types into Rails form inputs through a small DSL. It is for Rails teams that want defaults without giving up control of the markup.
- Who is it for?
- Adopt Simple Form if you are on a supported Rails version and you want column-driven defaults without a markup framework of its own; skip it if you need a form object layer or you are not on Rails. Before wiring it into a large app, run rails generate simple_form:install in a scratch branch and read the generated initializer, because that file, not the README, is where the wrapper and input mapping decisions actually live.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Activity is slowing. The repository last received commits 6 months ago.
- What is it written in?
- Mainly Ruby, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The problem Simple Form solves for Rails teams
Rails ships form helpers that work, and the README says so directly: Simple Form "does not aim to create a lot of different logic from the default Rails form helpers, as they do a great job by themselves." The gap it fills is repetition. Writing f.label, f.text_field, error blocks and hint paragraphs for every attribute of every model is mechanical work, and the shape of that work is already implied by the column type in the database.
Simple Form reads that type and picks an input for you. A string column becomes a text field, a boolean becomes a check box, a date becomes a date select. The README calls this mapping the core idea: the gem "acts as a DSL and just maps your input type (retrieved from the column definition in the database) to a specific helper method." That is the whole pitch. It is for Rails developers who have accepted ActiveRecord conventions and want the form layer to follow the same conventions instead of restating them per view.
The second half of the promise is what it refuses to do. The project states that its basic goal is "to not touch your way of defining the layout." There is no shipped stylesheet, no grid, no component classes. If you have an existing markup system, Simple Form is meant to sit underneath it rather than replace it.
How the input mapping and wrapper stack actually work
A call like f.input :username is not one helper. According to the README, Simple Form is "a stack of components that are invoked to create a complete html input for you, which by default contains label, hints, errors and the input itself." Each of those pieces is rendered separately and can be turned off or reconfigured individually, which is why the DSL accepts label: false, hint: false and error_html: in the same call.
Wrappers are the other half of the mechanism. The generated initializer defines wrapper configurations, and the README documents a wrappers API for changing them. A wrapper decides what markup surrounds the label, the input and the error message. This is the layer you edit when you want Bootstrap-style markup without hand-writing every field, and it is also the layer that makes the gem's no-opinion claim true in practice: the opinion lives in a config file you own, not in the gem's rendering code.
Options flow through three levels. Per-input options win. Form-level defaults set with defaults: in simple_form_for apply to every input in that form. Global settings live in the initializer. The README gives the precedence rule explicitly: "Specific options in input call will overwrite the defaults." That ordering is simple, but it means a debugging session about a stray CSS class usually ends in the initializer rather than the view.
Input type selection can also be remapped globally. The README shows config.input_mappings = { /country/ => :string } as the way to override the built-in country input when you do not want the country_select gem. That regex-keyed hash is the escape hatch for any column whose default input type you disagree with.
Installing simple_form and rendering a first form
The README gives a three-step install. Add the gem to your Gemfile, run bundle install, then run the generator. The generator is the step that matters, because it writes the initializer that holds your wrapper and mapping configuration.
gem 'simple_form'bundle installrails generate simple_form:installIf you want the Bootstrap 5 wrappers, the README documents a flag on that same generator. It writes an initializer configured for Bootstrap 5 form controls, and the README is explicit that you still need to have the Bootstrap assets in your application yourself.
rails generate simple_form:install --bootstrapThere is a matching --foundation option for Zurb Foundation 5. One caveat is stated plainly in the README: the Foundation wrapper "does not support the :hint option by default," and enabling hints means uncommenting a line in config/initializers/simple_form_foundation.rb and supplying your own CSS for them.
With the generator run, the first real form is a swap of the helper name. Replace form_for with simple_form_for and use f.input instead of the per-attribute helpers.
<%= simple_form_for @user do |f| %>
<%= f.input :username %>
<%= f.input :password %>
<%= f.button :submit %>
<% end %>The README says this generates a complete form with labels for both fields and renders errors by default when the form is redisplayed with invalid data. If you want a country select, the README points at the separate country_select gem, or at the input_mappings override shown above. The README does not document a rollback path for the generator, so treat the generated initializer as a file you edit rather than one you regenerate casually.
Where simple_form gets in the way
The column-driven default is the feature and the failure mode at the same time. It assumes your form fields correspond to database columns. The moment a form stops being a thin view over one table, the mapping has nothing to read. The README has a section on using non Active Record objects, which is the acknowledgement that this case exists, but the gem's centre of gravity is still the ActiveRecord column.
HTML 5 is a second boundary the project marks itself. The README has a dedicated HTML 5 Notice section, which is the kind of heading a library adds when browser behaviour has surprised its users. If you are chasing native constraint validation behaviour, read that section before you assume the generated inputs do what you expect.
The wrapper layer is also more configurable than it is documented. The README links out to the wrappers API and to custom components, but the practical detail lives in the generated initializer and in the RDocs. A team that wants an unusual markup structure will spend its time reading generated config and source, not the README. That is a fair trade for a library that refuses to impose markup, but it is not a five-minute integration.
Finally, the Foundation path is visibly less finished than the Bootstrap path. A wrapper that ships with hints disabled and expects you to write the hint CSS is a wrapper for people who already have a Foundation app and know its stylesheet conventions.
simple_form against Formtastic and plain Rails helpers
The README states that most of the DSL "was inherited from Formtastic," and thanks that project for it. The two libraries are close relatives, and the practical difference for a new project is maintenance and direction rather than syntax. If you are choosing today, the relevant question is which project's wrapper conventions and release cadence match your Rails version, not which DSL reads better, because the DSL is largely the same.
Against the built-in Rails helpers, the difference is sharper. Plain Rails gives you f.text_field and leaves labels, hints and error rendering to you. Simple Form gives you f.input and decides all of that from the column type, then lets you override each piece. The cost is an initializer and a wrapper configuration to understand; the benefit is that adding a field to a form is one line. If your forms are few and heavily bespoke, plain helpers plus a partial is less machinery. If your application is a conventional CRUD surface over many models, the per-field boilerplate you delete is real.
There is also a middle path worth naming: you can keep simple_form_for and drop to the underlying Rails helpers inside the block. The README has a section on wrapping Rails form helpers, which is the documented way to mix the two rather than committing the whole view to the DSL.
Maintenance, licence and upgrade cost
The repository is not archived, and the last push was on 2026-04-01. The most recent release listed is v5.4.1 from 2026-01-05, with v5.4.0 in 2025-10-24 and v5.3.0 back in 2023-10-11. That spacing is worth reading carefully before you plan an upgrade: the jump from 5.3.0 to 5.4.0 covers roughly two years of accumulated change, so a project still on 5.3 will be crossing a wide gap rather than applying a small patch. The README also notes that it documents Simple Form 5.0 and points older releases at their own branch, so version drift in documentation is expected.
The gem is MIT licensed. MIT is permissive and imposes no copyleft obligation on your application, but the licence text in MIT-LICENSE is the authority, and if you are redistributing the gem or embedding it in a product with unusual licensing constraints, that is a question for your own counsel rather than something a README can settle.
Upgrade cost concentrates in one file. Because wrappers, input mappings and defaults all live in the generated initializer, a major version bump is mostly a diff against that initializer plus the deprecation notes in CHANGELOG.md. The repository keeps a CHANGELOG.md at the top level, and that is the file to read before bumping the Gemfile constraint. The README does not describe a migration tool or an automated upgrade path.
Editorial conclusion
Adopt Simple Form if you are on a supported Rails version and you want column-driven defaults without a markup framework of its own; skip it if you need a form object layer or you are not on Rails. Before wiring it into a large app, run rails generate simple_form:install in a scratch branch and read the generated initializer, because that file, not the README, is where the wrapper and input mapping decisions actually live.
Frequently asked questions
What is the simple_form gem?
It is a Ruby gem for Rails that provides a form DSL, mapping the input type taken from the database column definition to a specific Rails helper method. The README describes it as a stack of components that renders a label, hints, errors and the input itself, with no opinion on your markup.
How do I install simple_form in a Rails app?
Add gem 'simple_form' to your Gemfile, run bundle install, then run rails generate simple_form:install. The generator writes the initializer that holds your wrapper and input mapping configuration; passing --bootstrap or --foundation selects a different wrapper set.
Does simple_form work with Bootstrap 5?
Yes. The README documents rails generate simple_form:install --bootstrap, which writes an initializer configuring wrappers for Bootstrap 5 form controls. You still need to add the Bootstrap assets to your application yourself.
How do I change which input type simple_form uses for a column?
Use config.input_mappings in the simple_form.rb initializer. The README gives config.input_mappings = { /country/ => :string } as the example, which remaps country inputs to a plain string input instead of the country_select-based one.
Why are hints missing from the Foundation wrapper in simple_form?
The README states that the Foundation wrapper does not support the :hint option by default. To enable hints you uncomment the relevant line in config/initializers/simple_form_foundation.rb and provide your own CSS styles for them.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/heartcombo-simple-form)