govuk-form-builder

A form builder for Ruby on Rails that’s compatible with the GOV.UK Design System.

MIT License

Downloads
694K
Stars
75

Bot releases are visible (Hide)

govuk-form-builder - Version 2.1.8

Published by peteryates over 3 years ago

  • Upgrade to GOV.UK Frontend version 3.11.0. The main change here was the addition of support for button groups. Now, whenever a block of content is passed into #govuk_submit, the submit element and all the additional content is wrapped in a div.govuk-button-group element, which automatically arranges and spaces the buttons/links within. The old behaviour of adding some margin to the right of the submit element has been dropped completely #237
govuk-form-builder - Version 2.1.7

Published by peteryates over 3 years ago

  • Officially support Rails 6.1.1 #236
  • Improve behaviour on collection methods when passed symbols by converting them to strings. When labels are generated within procs using symbols instead of strings the output is malformed and they didn't link to the corresponding input correctly. This is very much an edge case and noticed when reviewing an example in the guide #235
  • Several refactorings based on vanilla Rubocop violations #234
  • Add ability to publish gems via Github actions #229
govuk-form-builder - Version 2.1.6

Published by peteryates almost 4 years ago

  • Add support for Rails 6.1.0 #226
  • Increase supported version of govuk-frontend to 3.10.2 #228
  • Add an option to include a hidden field in #govuk_collection_radio_buttons #227
govuk-form-builder - Version 2.1.5

Published by peteryates almost 4 years ago

  • Upgrade to Version 3.10.0 of the GOV.UK Frontend #221
  • Add support for adding wildcards to date patterns via the wildcards option on #govuk_date_field #220
  • Migrate from TravisCI to Github Actions #219
govuk-form-builder - Version 2.1.4

Published by peteryates almost 4 years ago

  • Fix a bug where custom attributes aren't applied to legends. The root of the problem was that the legend implementation differed heavily from the label and hint implementations; this change brings them inline and the bug #216 is fixed as a result. Thanks to @paulrobertlloyd for reporting and diagnosing the bug. #217
govuk-form-builder - Version 2.1.3

Published by peteryates almost 4 years ago

  • Fix a bug where hint: nil was not suppressing hints when matching localisations exist. Thanks to @cpjmcquillan for reporting this. #212, #213
govuk-form-builder - Version 2.1.2

Published by peteryates almost 4 years ago

  • Fix a bug where localised fieldset hints were being applied to the checkboxes within. Thanks to @zheileman for diagnosing and fixing this! #211
govuk-form-builder - Version 2.1.1

Published by peteryates almost 4 years ago

  • Enhance #govuk_error_summary by allowing errors on the object's :base to link to the field specified in the link_base_errors_to: argument. The automatically-generated href would contains the word base (eg person-base-field-error) so won't link to any of the fields. If the argument isn't provided the the old behavoiur remains as-is. Thanks to @friedsock for reporting this. #209
govuk-form-builder - Version 2.1.0

Published by peteryates about 4 years ago

  • Prevent the form builder from unnecessarily wrapping legends in heading tags. This has been the behaviour of this library since the beginning due to my misunderstanding of the official docs. Now for legends, the default is tag: nil and the legend text won't be wrapped by any other tag. Many thanks to @fofr for diagnosing the problem in #201, #204

But I've already worked around this behaviour and don't want anything to change

To continue wrapping legends in a h1 and maintain the old behaviour throughout, just set the default back to h1:

GOVUKDesignSystemFormBuilder.configure do |conf|
  conf.default_legend_tag = 'h1' 
end
govuk-form-builder - Version 2.0.0

Published by peteryates about 4 years ago

  • Replace the form_group_classes argument with form_group and allow it to take either a Hash or Proc #173
  • Replace hint_text with hint and allow it to take either a Hash or Proc #174
  • Add support for input prefixes and suffixes #159
  • Display a default legend if one hasn't been specified (can be omitted with nil) #185
  • Add extra arguments passed to hint, label, caption and legend hashes as HTML attributes on the relevant element #190
  • Improve govuk_check_boxes_fieldset behaviour with regard to hidden fields:
    • add a hidden field by default when rendering a check boxes fieldset #192
    • allow the hidden field to be suppressed using the multiple flag #196
  • Show ERB examples in the guide in addition to Slim ones #181

Upgrade guide

See #175 for more details, but the main things to look out for are:

  • Replace hint_text: 'blah' with hint: { text: 'blah' }
  • Replace form_group_classes: %w(polka-dots) with form_group: { classes: %w(polka-dots) }
  • Ensure forms with #govuk_check_boxes_fieldset are able to be submitted with a present but empty param instead of none. There is now a valueless #hidden_field added to the form to represent an unchecked state (see #192, #196)
  • If your app has fieldsets associated with attributes that have no legend, a default legend will be automatically added in a way consistent with labels. To suppress it, pass in legend: nil. This probably doesn't affect anyone because legendless fieldsets aren't a good idea, but just in case

Please get in touch with @peteryates or raise an issue if there are any breakages while upgrading

govuk-form-builder - Version 1.2.9

Published by peteryates about 4 years ago

  • Flip #govuk_checkbox's unchecked_value default back to false for the moment, it causes too much of a change in the output HTML for a minor release. The option to override it remains in place but the default behaviour is now the same as in v1.2.7. #193
govuk-form-builder - Version 1.2.8

Published by peteryates about 4 years ago

  • Fix a bug where the hidden field that's meant to accompany a check box isn't rendered. It turns out that defaulting the unchecked_value to false instead of 0 makes Rails omit the hidden field altogether - I'd love to know why! Now the unchecked_value defaults to 0 but can be overridden if necessary. Thanks again to @zheileman for helping confirm the behaviour #192
govuk-form-builder - Version 1.2.7

Published by peteryates about 4 years ago

  • Support GOV.UK Design System 3.8.1 #176
  • Some minor refactoring, tidying up and documentation improvements #169
govuk-form-builder - Version 1.2.6

Published by peteryates about 4 years ago

  • Supports GOV.UK Design System 3.8.0 #167
  • Set Slim format to :html to improve guide markup #165
  • Improve test coverage, it's back at 100% #163
govuk-form-builder - Version 1.2.5

Published by peteryates over 4 years ago

  • Add support for customising the classes on form groups #160
  • Allow classes arguments to be passed either a String or Array #160
  • More refactoring and simplifying the codebase #152
govuk-form-builder - Version 1.2.4

Published by peteryates over 4 years ago

  • Allow custom classes to be set on govuk_select and add documentation for undocumented args (options and html_options), thanks to @david-mears-dfe for reporting this #154
  • Continuing the large refactor and simplification #151
  • Dependabot updates to rubocop, rouge and sassc #156, #155, #157
govuk-form-builder - Version 1.2.3

Published by peteryates over 4 years ago

  • Fix a bug where captions (#135) from the radio button fieldset were leaking into the contained radio button labels. Thanks @zheileman for diagnosing and fixing this! #149
  • Add another set of HTML formatting specs that ensure attributes are correctly-formatted and contain no double spaces
govuk-form-builder - Version 1.2.2

Published by peteryates over 4 years ago

  • Fix minor formatting bug where trailing whitespace was being added to a HTML attribute. Thanks to @zheileman for reporting #147
govuk-form-builder - Version 1.2.1

Published by peteryates over 4 years ago

  • Add support for disabled submit buttons. Many thanks @cpjmcquillan 👍 #144
  • Internal refactor and simplification of the HTML-building process #145
govuk-form-builder - Version 1.2.0

Published by peteryates over 4 years ago

  • Officially support GOV.UK Design System 3.7.0 #140
  • Add support for using the form builder with other design systems by allowing the class and attribute prefixes (govuk-) to be changed throughout via a configuration option #127
  • Add full support for adding captions to labels and legends, also make both labels and legends more flexible by allowing them to be set using a proc #135
  • Improve the documentation around setting the link_errors when using #govuk_check_boxes_fieldset and #govuk_radio_buttons_fieldset #131
  • Upgrade supported versions of Ruby (2.7.1, 2.6.6, 2.5.8) and Rails (6.0.3, 5.2.4) #141
Package Rankings
Top 3.89% on Rubygems.org
Badges
Extracted from project README
Tests Maintainability Gem version Gem Test Coverage GitHub license GOV.UK Design System version Rails Ruby Netlify Status
Related Projects