Every Rails app I have started the last few years, includes the same custom form builder. I have copied this one file from app to app, it is not pretty but it keeps every input style in one place and it turns four lines of markup into one (think of it as simpler simple_form —if you know, you know—except you own the code, which I like in this case).
Add is as the default
First, look at what the form looks like when I write it. Here is a part of the settings page in the demo app .
<%= form_with model : @workspace do | form | %> <%= form . input :name %> <%= form . input :website , label_suffix : "Optional" %> <%= form . input :description , as : :text %>
<%= form . submit %> <% end %>
Enter fullscreen mode
Exit fullscreen mode
No need to add classes or wrapper divs.…