formbuilder-rb 0.0.1 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/formbuilder/forms_controller.rb +3 -3
- data/app/models/formbuilder/form.rb +4 -0
- data/app/models/formbuilder/response_field_checkboxes.rb +2 -2
- data/app/models/formbuilder/response_field_file.rb +1 -1
- data/app/models/formbuilder/response_field_radio.rb +2 -2
- data/lib/formbuilder/form_renderer.rb +2 -2
- data/lib/formbuilder/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e4893ebfa92c93b1c9e306f32cc8b5ed48aaf33
|
4
|
+
data.tar.gz: f83905df1c6d607cdf3ea7d3bc5fff8d497952e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ae9b52dc25a6537a05b0761112e452679f8777181a1d2d368d2a2f2e93323a5b310d5da779cfd2d20c799f3e4de4c5511882095ae30dae1058dc3f3449733f1
|
7
|
+
data.tar.gz: 5dda69d10ba76a7b43f28d82a86a740fa35150a56a98a6ebe419554520eff56cabdbc51a72693fa1143d3ab19cc61a7c54092288a45f104c89be27f4b2ece2e0
|
@@ -32,7 +32,7 @@ module Formbuilder
|
|
32
32
|
rf.cid = cids[rf.id]
|
33
33
|
end
|
34
34
|
|
35
|
-
render json: @form.
|
35
|
+
render json: @form.response_fields_json
|
36
36
|
end
|
37
37
|
|
38
38
|
private
|
@@ -41,8 +41,8 @@ module Formbuilder
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def transformed_field_params(field_params, i)
|
44
|
-
filtered_params = field_params.
|
45
|
-
|
44
|
+
filtered_params = field_params.select { |k, _|
|
45
|
+
k.to_sym.in?(Formbuilder::ResponseField::ALLOWED_PARAMS)
|
46
46
|
}.merge(
|
47
47
|
sort_order: i,
|
48
48
|
type: "Formbuilder::ResponseField#{field_params[:field_type].camelize}"
|
@@ -14,7 +14,7 @@ module Formbuilder
|
|
14
14
|
checked = value.present? ? value[option['label']] : (option['checked'] == 'true')
|
15
15
|
|
16
16
|
"""
|
17
|
-
<label>
|
17
|
+
<label class='fb-option'>
|
18
18
|
<input type='checkbox' name='response_fields[#{self[:id]}][#{i}]' #{checked ? 'checked' : ''} value='on' />
|
19
19
|
#{option['label']}
|
20
20
|
</label>
|
@@ -23,7 +23,7 @@ module Formbuilder
|
|
23
23
|
|
24
24
|
if self[:field_options]['include_other_option']
|
25
25
|
str += """
|
26
|
-
<div class='
|
26
|
+
<div class='fb-option'>
|
27
27
|
<label>
|
28
28
|
<input type='checkbox' name='response_fields[#{self[:id]}][other_checkbox]' #{value['Other'] ? 'checked' : ''} value='on' />
|
29
29
|
Other
|
@@ -14,7 +14,7 @@ module Formbuilder
|
|
14
14
|
checked = (value == option["label"]) || (value.blank? && option["checked"])
|
15
15
|
|
16
16
|
"""
|
17
|
-
<label>
|
17
|
+
<label class='fb-option'>
|
18
18
|
<input type='radio' name='response_fields[#{self[:id]}]' #{checked ? 'checked' : ''} value='#{option['label']}' />
|
19
19
|
#{option['label']}
|
20
20
|
</label>
|
@@ -23,7 +23,7 @@ module Formbuilder
|
|
23
23
|
|
24
24
|
if self[:field_options]['include_other_option']
|
25
25
|
str += """
|
26
|
-
<div class='
|
26
|
+
<div class='fb-option'>
|
27
27
|
<label>
|
28
28
|
<input type='radio' name='response_fields[#{self[:id]}]' #{value == 'Other' ? 'checked' : ''} value='Other' />
|
29
29
|
Other
|
@@ -42,7 +42,7 @@ module Formbuilder
|
|
42
42
|
value = @entry.try(:response_value, @field)
|
43
43
|
|
44
44
|
"""
|
45
|
-
<div class='
|
45
|
+
<div class='fb-field-wrapper response-field-#{@field.field_type} #{@entry.try(:error_for, @field) && 'error'}'>
|
46
46
|
#{render_label}
|
47
47
|
#{@field.render_input(value, entry: @entry)}
|
48
48
|
<div class='cf'></div>
|
@@ -93,7 +93,7 @@ module Formbuilder
|
|
93
93
|
def render_actions
|
94
94
|
"""
|
95
95
|
<div class='form-actions'>
|
96
|
-
<button class='button'>Submit</button>
|
96
|
+
<button class='button primary'>Submit</button>
|
97
97
|
<a class='button save-draft-button' data-loading-text='All changes saved'>Save draft</a>
|
98
98
|
</div>
|
99
99
|
""".html_safe
|
data/lib/formbuilder/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: formbuilder-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Becker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -251,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
251
|
version: '0'
|
252
252
|
requirements: []
|
253
253
|
rubyforge_project:
|
254
|
-
rubygems_version: 2.
|
254
|
+
rubygems_version: 2.1.11
|
255
255
|
signing_key:
|
256
256
|
specification_version: 4
|
257
257
|
summary: Rails backend for https://github.com/dobtco/formbuilder
|