superform 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/superform/rails.rb +3 -2
- data/lib/superform/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f08aba5c447c430ce4e06c86dacf7a6bc97cf95fd7ce379e913498fe3e809ab7
|
4
|
+
data.tar.gz: ce49b9e40f9f7ff9cc4bd2260918af3c16fa8689c3718281077170b9532613e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a392d567cba45cf0215131d00ef2557c4989cf020ded8d88f43c6d98c410ae743a629f322fab86addaa0980667a1af335a0effe318bd3d01adbeafcd1c543d5b
|
7
|
+
data.tar.gz: e7d2b01c137cefa7e0e6cefda057005af5f4e297e1e26b36be96f1c1276b0854ccd0352217d30efce471a7c08f1dda2ed5e024e9193321ebae922a9d32f04829
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -157,7 +157,7 @@ class SignupForm < ApplicationForm
|
|
157
157
|
|
158
158
|
div do
|
159
159
|
render field(:agreement).label { "Check this box if you agree to give us your first born child" }
|
160
|
-
render field(:agreement).
|
160
|
+
render field(:agreement).checkbox(checked: true)
|
161
161
|
end
|
162
162
|
|
163
163
|
render button { "Submit" }
|
data/lib/superform/rails.rb
CHANGED
@@ -254,11 +254,12 @@ module Superform
|
|
254
254
|
# Rails has a hidden and checkbox input to deal with sending back a value
|
255
255
|
# to the server regardless of if the input is checked or not.
|
256
256
|
input(name: dom.name, type: :hidden, value: "0")
|
257
|
-
|
257
|
+
# The hard coded keys need to be in here so the user can't overrite them.
|
258
|
+
input(type: :checkbox, value: "1", **attributes)
|
258
259
|
end
|
259
260
|
|
260
261
|
def field_attributes
|
261
|
-
{ id: dom.id, name: dom.name,
|
262
|
+
{ id: dom.id, name: dom.name, checked: field.value }
|
262
263
|
end
|
263
264
|
end
|
264
265
|
|
data/lib/superform/version.rb
CHANGED