govuk_design_system_formbuilder 2.0.0b4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +17 -25
- data/lib/govuk_design_system_formbuilder/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f87c2ecd9fbd0615a3061159d7e87b42254115db22f59c260a6e4209f7ff742d
|
|
4
|
+
data.tar.gz: a167bde412b2158d9ed303af32e730d5ae27876b1ac4ee80d675b9bc81d15126
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d184b3fa9ed93c35ea9ef15a72bf79f3520632fd3f501d93cc089a2e4b4e73fb73c2078083a9e0785f812802f2b406c972b568033148c9875bf1c4906ee9122
|
|
7
|
+
data.tar.gz: 3462d38207e9220b41bc3bc899d5218bc9ef982e609e2c96f58abbe0d8d20d9e9bd515b1be4566f77b37a4b543e0929a02fd9fa18bb0001815067aa0e6b07ea9
|
data/README.md
CHANGED
|
@@ -7,41 +7,32 @@
|
|
|
7
7
|
[](https://codeclimate.com/github/DFE-Digital/govuk_design_system_formbuilder/test_coverage)
|
|
8
8
|
[](https://dependabot.com)
|
|
9
9
|
[](https://github.com/DFE-Digital/govuk_design_system_formbuilder/blob/master/LICENSE)
|
|
10
|
-
[](https://design-system.service.gov.uk)
|
|
11
11
|
|
|
12
|
-
This
|
|
13
|
-
fully-compliant with version 3.9.0 of the [GOV.UK Design System](https://design-system.service.gov.uk/),
|
|
14
|
-
minimising the amount of markup you need to write.
|
|
12
|
+
This library provides an easy-to-use form builder for the [GOV.UK Design System](https://design-system.service.gov.uk/).
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
System is exposed via the API. Adding [JavaScript-enhanced word count
|
|
18
|
-
checking](https://govuk-form-builder.netlify.app/form-elements/text-area/)
|
|
19
|
-
to text areas or [setting the size and weight of
|
|
20
|
-
labels](https://govuk-form-builder.netlify.app/introduction/labels-hints-and-legends/)
|
|
21
|
-
on text fields requires only a single argument.
|
|
14
|
+
It is intended to make creating forms **quick**, **easy** and **familiar** for Ruby on Rails developers.
|
|
22
15
|
|
|
23
16
|
## Documentation 📚
|
|
24
17
|
|
|
25
18
|
The gem comes with [a full guide](https://govuk-form-builder.netlify.app/) that
|
|
26
|
-
covers most aspects of day-to-day use, along with code and output examples. The
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
If you're still not sure what a form builder is or how it works, don't worry!
|
|
30
|
-
[This screencast](https://www.youtube.com/watch?v=PhoFZ0qXAlA) should give you
|
|
31
|
-
an idea of what's on offer and the official guide goes into a bit more depth on
|
|
32
|
-
how everything works.
|
|
19
|
+
covers most aspects of day-to-day use, along with code and output examples. The
|
|
20
|
+
examples in the guide are generated from the builder itself so it will always
|
|
21
|
+
be up to date.
|
|
33
22
|
|
|
34
23
|
[](https://app.netlify.com/sites/govuk-form-builder/deploys)
|
|
35
24
|
|
|
36
25
|
## What's included 🧳
|
|
37
26
|
|
|
38
27
|
* 100% compatibility with the GOV.UK Design System
|
|
39
|
-
* Full control of labels, hints,
|
|
28
|
+
* Full control of labels, legends, hints, captions and fieldsets
|
|
40
29
|
* No overwriting of Rails' default form helpers
|
|
41
30
|
* Automatic ARIA associations between hints, errors and inputs
|
|
42
31
|
* Most helpers take blocks for arbitrary content
|
|
43
32
|
* Additional params for programmatically adding hints to check box and radio
|
|
44
33
|
button collections
|
|
34
|
+
* Full I18n support
|
|
35
|
+
* Automatic handling of ActiveRecord validation error messages
|
|
45
36
|
* No external dependencies
|
|
46
37
|
* An exhaustive test suite
|
|
47
38
|
* [Extensive technical documentation](https://www.rubydoc.info/gems/govuk_design_system_formbuilder/GOVUKDesignSystemFormBuilder/Builder)
|
|
@@ -68,8 +59,9 @@ pre-configured template:
|
|
|
68
59
|
|
|
69
60
|
## Setup 🔧
|
|
70
61
|
|
|
71
|
-
To use the form builder in an ad hoc basis you can specify it
|
|
72
|
-
|
|
62
|
+
To use the form builder in an ad hoc basis you can specify it as an argument to
|
|
63
|
+
`form_for` or `form_with`. These examples are written in [Slim](https://slim-lang.com) but
|
|
64
|
+
other templating languages like ERB and [Haml](https://haml.info/) work just as well.
|
|
73
65
|
|
|
74
66
|
```slim
|
|
75
67
|
= form_for @some_object, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f|
|
|
@@ -99,16 +91,16 @@ Now we can get started!
|
|
|
99
91
|
:name,
|
|
100
92
|
:description,
|
|
101
93
|
label: { text: "Which department do you work for?" },
|
|
102
|
-
|
|
94
|
+
hint: { text: "If you don't know ask your manager" }
|
|
103
95
|
|
|
104
96
|
= f.govuk_submit 'Away we go!'
|
|
105
97
|
```
|
|
106
98
|
|
|
107
99
|
## Developing and running the tests 👨🏻🏭
|
|
108
100
|
|
|
109
|
-
The form builder is
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
The form builder is tested with RSpec. To run all the tests first ensure that
|
|
102
|
+
the development and testing prerequisite gems are installed. At the root of a
|
|
103
|
+
freshly-cloned repo run:
|
|
112
104
|
|
|
113
105
|
```sh
|
|
114
106
|
bundle
|
|
@@ -117,7 +109,7 @@ bundle
|
|
|
117
109
|
Now, if everything was successful, run RSpec:
|
|
118
110
|
|
|
119
111
|
```sh
|
|
120
|
-
bundle exec rspec
|
|
112
|
+
bundle exec rspec
|
|
121
113
|
```
|
|
122
114
|
|
|
123
115
|
## Contributing 📦
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_design_system_formbuilder
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Yates
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-09-
|
|
11
|
+
date: 2020-09-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|
|
@@ -314,9 +314,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
314
314
|
version: '0'
|
|
315
315
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
316
|
requirements:
|
|
317
|
-
- - "
|
|
317
|
+
- - ">="
|
|
318
318
|
- !ruby/object:Gem::Version
|
|
319
|
-
version:
|
|
319
|
+
version: '0'
|
|
320
320
|
requirements: []
|
|
321
321
|
rubygems_version: 3.1.2
|
|
322
322
|
signing_key:
|