bootstrap-ruby/bootstrap_form
67.6
Adequate · 19 September 2026
2.1k
lines of production code
Ruby
primary language
1
measurement over time
What this system is
This system is a Ruby gem that provides a Rails engine for generating Bootstrap 5-styled forms within Rails applications. It offers a suite of view helpers and modular components to handle form building, validation, and layout, ensuring consistent styling and accessibility. The project includes a comprehensive demo application that serves as a reference implementation and a testbed for visual regression testing across multiple Rails versions.
How it got here
2012–2013 — Rails engine modernization and Bootstrap 5 support
8 changes.
The project underwent a significant architectural overhaul, restructuring the library as a proper Rails engine with modular components and modernized loading conventions. Concurrently, support was upgraded to Rails 7.2+ and Bootstrap 5.3, accompanied by comprehensive test coverage and the removal of legacy Rails 3 artifacts. Development workflows were also standardized through the introduction of Docker-based environments.
2014–2018 — Rails 7+ demo modernization and Bootstrap 5 support
12 changes.
The project updated its core library to support Bootstrap 5 and restructured its helper logic, while simultaneously migrating the demo application to Rails 7.1 with modern asset pipelines and tooling. This period focused on creating a comprehensive, up-to-date reference implementation featuring rich text editing, file uploads, and interactive code previews to showcase the library's capabilities.
2019–2023 — Bootstrap 5 migration and modularization
11 changes.
The project underwent a comprehensive migration to Bootstrap 5, introducing new form helper methods and refactoring input and component logic into modular, maintainable structures. This period also focused on strengthening the codebase by adding support for newer Rails versions and implementing robust Dockerized system tests with visual regression capabilities for the demo application.
Features
Add Bootstrap form helper methods for Rails views
The library now provides \bootstrap\_form\_for\, \bootstrap\_form\_with\, \bootstrap\_form\_tag\, \bootstrap\_fields\_for\, and \bootstrap\_fields\ helpers. These methods wrap standard Rails form helpers to automatically use the BootstrapForm builder, ensuring consistent Bootstrap styling for form elements and error handling without requiring manual configuration in each view.
_lib/bootstrap\_form/action\_view\extensions · high confidence
Add demo application models for form and validation examples
The demo application now includes a set of model files (User, Address, Skill, FauxUser, ModelUser, SuperUser, and ApplicationRecord) to support various form-building scenarios. These models demonstrate Active Record associations (User has one Address), Active Model validations (presence, acceptance, length), serialization of preferences, and the use of rich text fields (has\_rich\_text). They also include plain Ruby objects (FauxUser, ModelUser) to illustrate form handling with non-Active Record classes, and a Skill model to provide example data for collection inputs.
demo/app/models · high confidence
Automated CI commit task for generated files
A new Rake task has been added to the demo library to automatically commit and push files generated during CI runs, such as screenshots. This task configures the git user as 'github-actions' and commits all changes with a message instructing developers to review the auto-generated files and pull the changes into their local branch.
demo/lib · high confidence
Demo app adds Bootstrap helper for form source code preview
The demo application now includes a BootstrapHelper that wraps form outputs in a toggleable view, allowing users to see the generated HTML source code alongside the rendered form.
demo/app/helpers · high confidence
Demo app adds comprehensive Bootstrap form layout examples
The demo application now includes a new view demonstrating various Bootstrap form layouts, including horizontal, inline, and validation error states. It showcases specific form helpers such as \rich\_textarea\ for Action Text support and the \floating\ option for floating labels, providing users with concrete examples of these UI patterns.
demo/app/views/bootstrap · high confidence
Introduce Docker-based development environment
Developers can now use Docker Compose and VS Code Dev Containers to run the gem's demo application and test suite in an isolated, consistent environment. This change adds configuration files (.devcontainer.json, compose.yml, DOCKER.md) and updates the CONTRIBUTING guide to recommend Docker for local development, ensuring reproducible builds and simplifying setup for contributors.
(repo-wide) · high confidence
Removals
Removal of version constant file
The version constant file (version.rb) has been removed from the lib/form-bootstrap directory, eliminating the explicit version definition for the FormBootstrap module.
lib/form-bootstrap · high confidence
Architecture
BootstrapForm restructured as a Rails engine with new module architecture
The library has been refactored from a simple module into a proper Rails engine, replacing the legacy \FormBootstrap\ module and removing obsolete rake tasks. This change introduces a modernized structure using \ActiveSupport::Autoload\ for lazy loading of components like FormBuilder, FormGroupBuilder, and Inputs, while also establishing a centralized deprecation mechanism via \ActiveSupport::Deprecation\ to manage future API changes. Users benefit from improved maintainability and better integration with Rails' loading conventions.
lib · high confidence
Behavioural changes
Bootstrap 5 migration and helper restructuring
The library has been updated to support Bootstrap 5, which involves moving helper logic into a new \lib/bootstrap\_form/helpers\ directory and refactoring core components like \alert\_message\, \error\_summary\, and \errors\_on\. This change alters the default rendering of error summaries (now enabled by default) and updates button styling classes (e.g., \btn-default\ to \btn-secondary\). Additionally, the \static\_control\ helper now supports forcing nil values, and the \prepend\_and\_append\_input\ logic has been refactored to handle multiple items and input group sizing classes more robustly.
_lib/bootstrap\form/helpers · high confidence
Bootstrap 5.6.1 release with Rails 7.2+ support
This update bumps the gem to version 5.6.1 and raises the minimum supported Rails version to 7.2, dropping support for older Rails releases. The release includes a comprehensive architectural overhaul of the form builder, introducing a modular structure with separate modules for components (hints, labels, layout, validation) and inputs. It also adds a new configuration system via \BootstrapForm.config\ and deprecates the legacy \default\_form\_attributes\ setter, while ensuring the engine properly registers the deprecator for Rails applications.
_lib/bootstrap\form · high confidence
Default date/time select widths and error summary styling
The \rails\_bootstrap\_forms.css\ stylesheet now explicitly sets date, time, and datetime select elements to \display: inline-block\ with \width: auto\, ensuring these controls do not stretch to full width by default. Additionally, a new \.rails-bootstrap-forms-error-summary\ class is defined with a top margin of 10px to provide spacing for error summary blocks.
app/assets · high confidence
Demo app asset manifest configuration
The demo application now includes a manifest configuration file that explicitly links the images directory and the builds directory, ensuring these assets are correctly processed and served.
demo/app/assets/config · medium confidence
Demo app configuration updated for Rails 7.1 and Bootstrap Form defaults
The demo application's configuration has been updated to align with Rails 7.1 standards and specific library defaults. The \bootstrap\_form\ initializer now explicitly sets \group\_around\_collections\ to true, changing how form collections are rendered. Asset configuration has been adjusted to include Bootstrap Icons in the load path, and the cookies serializer is set to JSON. Additionally, the demo directory structure has been consolidated by moving initializers from the test dummy app, and legacy settings like the JSON root element inclusion for ActiveRecord have been commented out to reflect modern defaults.
demo/config/initializers · high confidence
Demo app controllers reorganized and modernized
The demo application's controller structure has been updated: the base ApplicationController has been moved from the test dummy directory to the main demo folder and updated to use the modern \protect\_from\_forgery\ syntax. New controllers, BootstrapController and UsersController, have been added to support the demo's form examples, with BootstrapController providing pre-populated model instances (including those with validation errors) for rendering various UI states.
demo/app/controllers · high confidence
Demo app environment configurations updated to Rails 8 defaults
The demo application's development, production, and test environment configurations have been replaced with new files reflecting modern Rails defaults. Key changes include the adoption of \config.enable\_reloading\ for controlling code reloading, explicit \config.eager\_load\ settings, and updated Action Mailer defaults (such as \default\_url\_options\ and delivery methods). The production config now enforces SSL, uses STDOUT logging with request ID tags, and disables schema dumping, while the test config configures a null cache store and rescuable exception handling.
demo/config/environments · high confidence
Demo app layout refresh with CodeMirror integration
The demo application's layout structure has been updated to support richer content display and code preview capabilities. A new layout for Action Text contents was added to wrap content in a Trix editor container, while the main application layout now includes the CodeMirror library (version 5.33.0) via CDN. This enables interactive code snippets within the demo, allowing users to toggle between rendered examples and their underlying HTML source code with syntax highlighting.
demo/app/views/layouts · high confidence
Demo app refreshed to Rails 7.0 with modern asset pipeline
The demo application has been upgraded to Rails 7.0 and restructured from \test/dummy\ to a standalone \demo\ directory. This update introduces a modern JavaScript asset pipeline using Webpacker and Yarn, replacing the previous setup with new configuration files for development, production, and test environments. The app now utilizes the \trix\ editor via \@rails/actiontext\, integrates Bootstrap, and supports Action Cable for WebSocket features. Additionally, the Ruby version requirement has been updated to 3.2.7, and the application structure now includes dedicated directories for JavaScript packs, channels, and asset builds, providing a more current reference implementation for users.
demo · high confidence
Demo app restructured to Rails 7.1 with updated configuration
The demo application has been migrated to Rails 7.1, introducing a new configuration structure in the \demo/config\ directory. This includes a new \application.rb\ that loads Rails 7.1 defaults and conditionally enables \autoload\_lib\, a \boot.rb\ that integrates Bootsnap for faster startup, and a \ci.rb\ script that adds security audits (Importmap, Brakeman) alongside test steps. The database configuration (\database.yml\) has been refactored to use a shared default block for SQLite settings, and the app now includes standard Rails configuration files for Puma, Cable, Storage, and Webpacker, replacing the previous \test/dummy\ layout.
demo/config · high confidence
Demo app scaffolding and development tooling
The demo application now includes a complete set of executable binstubs in \demo/bin\ (such as \rails\, \puma\, \webpack\, and \setup\) to streamline local development and dependency management. Additionally, standard Rails error pages (400, 404, 422, 500) and static assets have been added to \demo/public\, and the favicon has been moved from the test dummy to the demo directory.
demo/bin · high confidence
Demo app styles updated for Bootstrap 5 and Action Text support
The demo application's stylesheet configuration has been updated to use Bootstrap 5, replacing the previous version with a new \application.bootstrap.scss\ that imports Bootstrap 5 and Bootstrap Icons. Additionally, new stylesheets for Action Text (\actiontext.css\ and \actiontext.scss\) have been added to properly format the Trix editor and fix image gallery layout issues within attachment galleries. The base \application.scss\ retains existing utility styles for required form labels and fragment borders.
demo/app/assets/stylesheets · high confidence
Refactored form component logic into modular concerns
The form rendering logic in \lib/bootstrap\_form/components\ has been reorganized into four distinct modules: \Hints\ (handling help text and i18n lookups), \Labels\ (managing label classes, text, and error integration), \Layout\ (determining horizontal, inline, or vertical layouts), and \Validation\ (checking for presence validators, association errors, and generating error messages). This change improves code maintainability by separating concerns without altering the external API or user-facing behavior of the form builder.
_lib/bootstrap\form/components · high confidence
Refactored form inputs into modular components with Bootstrap 5 layout updates
The form input helpers in lib/bootstrap\_form/inputs have been reorganized into individual, modular files (e.g., check\_box.rb, select.rb, text\_field.rb) that share a common base implementation. This refactoring introduces Bootstrap 5-specific styling, such as applying the 'form-select' class to select inputs and 'form-range' to range fields. It also deprecates the \:default\ layout option in favor of \:vertical\, adds support for append/prepend wrappers on collection selects, and improves accessibility by correctly setting ARIA attributes and required field indicators on checkboxes and radio buttons.
_lib/bootstrap\form/inputs · high confidence
Updated demo database schema for Active Storage and Action Text compatibility
The demo application's database schema has been updated to align with modern Rails Active Storage and Action Text requirements. This includes adding the \service\_name\ column to \active\_storage\_blobs\ to support configurable storage services, creating the \active\_storage\_variant\_records\ table to handle image variants, and allowing null checksums on blobs. The schema also includes the \action\_text\_rich\_texts\ table for rich text content. These changes ensure the demo app correctly supports file uploads and rich text editing features.
demo/db · high confidence
Fixes
Fix demo app asset directory structure
The placeholder file for the demo application's image assets has been moved from the test dummy models directory to the correct demo app assets location, ensuring the directory structure is properly maintained for the demo application.
demo/app/assets/images · high confidence
Test coverage
Added integration tests for demo controllers; Added system tests for Bootstrap form rendering and README example validation; Added test coverage for Bootstrap 5 form components and helpers; Dockerized system test infrastructure with screenshot diffing; Removed legacy Rails 3 dummy application scaffold.
Dependencies
Add gemfiles for Rails 7.2, 8.0, 8.1, and edge
The gemfiles directory now includes version-specific lockfiles for Rails 7.2, 8.0, 8.1, and the main branch (edge), enabling testing against these specific Rails versions. The 8.0 and 8.1 configurations use propshaft for asset management, while 7.2 continues to use sprockets-rails. A common.gemfile centralizes shared test and development dependencies, including puma, debug, and various testing libraries.
gemfiles · high confidence
Upgrade demo app to Rails 8.1 and Bootstrap 5.3
The demo application has been upgraded to Rails 8.1 (via @rails/actioncable, @rails/actiontext, and @rails/activestorage) and Bootstrap 5.3.2, along with updated tooling like esbuild 0.19.5 and sass 1.77.6. The gemspec now requires Ruby \>= 3.2 and depends on the current Rails version, while the main Gemfile has been refactored to use cssbundling-rails and jsbundling-rails with propshaft, replacing the previous Rails 3.1-era setup.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 68.
Lenses
- Code Health 99
- Architecture 88
- Maturity 60
- Readiness 57
- Security 94
- Domain Modelling 100
Changes since last survey
- 300 commits — 259 feature/other, 41 fixes
By area
- (root) — 85 commits
- lib/bootstrap_form — 58 commits
- (repo) — 35 commits
- demo/doc — 34 commits
- .github/workflows — 13 commits
- demo/app — 12 commits
- demo/test — 9 commits
- test/bootstrap_checkbox_test.rb — 7 commits
- demo/config — 6 commits
- test/bootstrap_fields_test.rb — 6 commits
- demo/Gemfile.lock — 5 commits
- gemfiles/common.gemfile — 4 commits
- test/test_helper.rb — 4 commits
- test/bootstrap_form_group_test.rb — 3 commits
- lib/bootstrap_form.rb — 2 commits
- test/bootstrap_collection_checkboxes_test.rb — 2 commits
- test/bootstrap_form_test.rb — 2 commits
- demo/Gemfile — 1 commit
- demo/Procfile.dev — 1 commit
- demo/bin — 1 commit
Notable commits
- fix: Add support for append and prepend on collection_select (fixes #428) (#641)
- fix: Added fields_for example with inline errors to the README.md Fixes #656
- fix: Added examples for check box /radio button collections with inline errors to the README.md Fixes #655
- fix: Allow array values for the label_col and control_col options. Fixes #703
- fix: CVE fix breaks serialization of symbols -- fix test
- fix: Changed in CI Please review the changes in the files in this commit carefully, as they were automatically generated during CI. Run git pull to bring the changes into your local branch. Then, if you do not want the changes, run git revert HEAD.
- fix: Ci fix 2024 03 01 (#726)
- fix: Fix Gemfile for 7.1
- fix: Fix README for both local and Docker test runs
- fix: Fix Rubocop offenses
- fix: Fix Rubocop offenses
- fix: Fix assets in the demo app (#678)
- fix: Fix broken section links in README.md [ci skip]
- fix: Fix build (#733)
- fix: Fix edge tests
- fix: Fix errors on screenshots (#716)
- fix: Fix joins not to make strings unsafe (#704)
- fix: Fix rubocop offences
- fix: Fix rubocop offenses
- fix: Fix rubocop:disable in test_helper
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
bootstrap-ruby/bootstrap_form was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 4331f790c2c04d1e6ed5e95f4a9e5787e74b8e7d — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.