activeadmin_polymorphic 0.3.4 → 0.3.5
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 89d652e6a88b7ce4327646cad44fc0cdd63cae2c
|
|
4
|
+
data.tar.gz: c9f95aa20ff37fba5c53a1d81da9593262e89217
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3353a3768d0ba7b451b4bc38730c235aa74518ca26cb303db6c82b514baaf9ab3e3fb31d02356e7424835c83c56892c7f32610a34111cb272e2926293d3281ee
|
|
7
|
+
data.tar.gz: 3edaa0d7d23f75e9383274b77bd4211da38949932c3ef504c386d1226b30858ce92211d9d95f9bb86203f22f1341c2bda9264b6bfaae6c9a5925e94b64567e91
|
data/README.md
CHANGED
|
@@ -67,8 +67,8 @@ This gem is a set of dirty hacks and tricks. Calling `polymorphic_has_many` make
|
|
|
67
67
|
* for new records it generates a dropdown with polymorphic types
|
|
68
68
|
* for exising records it generates two hidden fields with `id` and `type`
|
|
69
69
|
* then the real JavaScript starts, it extracts whole forms from polymorphic models new or edit pages, strips form actions, and inserts those forms right into the parent form
|
|
70
|
-
* when you try to submit forms, JavaScript submits subforms first; if subforms are invalid, it reloads them with
|
|
71
|
-
* after all subforms have been successfully saved, it strips them (because forms nested into other forms are
|
|
70
|
+
* when you try to submit forms, JavaScript submits subforms first; if subforms are invalid, it reloads them with errors and interrupts the main form's submission process
|
|
71
|
+
* after all subforms have been successfully saved, it strips them (because forms nested into other forms are semantically invalid, right?) and submits the parent form
|
|
72
72
|
|
|
73
73
|
# File uploads in subforms
|
|
74
74
|
|
|
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
s.license = "MIT"
|
|
9
9
|
s.name = "activeadmin_polymorphic"
|
|
10
10
|
s.version = ActiveadminPolymorphic::VERSION
|
|
11
|
-
s.authors = ["Petr Sergeev", "Sindre Moen"]
|
|
12
|
-
s.email = ["peter@hyper.no", "sindre@hyper.no"]
|
|
11
|
+
s.authors = ["Petr Sergeev", "Sindre Moen", "Vasiliy Ermolovich"]
|
|
12
|
+
s.email = ["peter@hyper.no", "sindre@hyper.no", "younash@gmail.com"]
|
|
13
13
|
s.description = 'This gem extends formtastic\'s form builder to support polymoprhic has many relations in your forms'
|
|
14
14
|
s.summary = 'HasMany polymoprhic support for active admin.'
|
|
15
15
|
s.homepage = "https://github.com/hyperoslo/activeadmin-polymorphic"
|
|
@@ -185,11 +185,17 @@ window.remoteSubmit = (target, callback) ->
|
|
|
185
185
|
xhr.setRequestHeader 'Accept', 'application/json'
|
|
186
186
|
.trigger('submit.rails')
|
|
187
187
|
.on 'ajax:aborted:file', (inputs) ->
|
|
188
|
+
$(parentForm).trigger('ajax:complete.rails')
|
|
189
|
+
|
|
188
190
|
false
|
|
189
191
|
.on 'ajax:error', (event, response, status) ->
|
|
192
|
+
$(parentForm).trigger('ajax:complete.rails')
|
|
193
|
+
|
|
190
194
|
if response.status == 422
|
|
191
195
|
loadErrors(target)
|
|
192
196
|
.on 'ajax:success', (event, object, status, response) ->
|
|
197
|
+
$(parentForm).trigger('ajax:complete.rails')
|
|
198
|
+
|
|
193
199
|
unless $(target).next().find('input:first').val() # create
|
|
194
200
|
$(target).next().find('input:first').val(object.id)
|
|
195
201
|
# replace new form with edit form
|
metadata
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activeadmin_polymorphic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Petr Sergeev
|
|
8
8
|
- Sindre Moen
|
|
9
|
+
- Vasiliy Ermolovich
|
|
9
10
|
autorequire:
|
|
10
11
|
bindir: bin
|
|
11
12
|
cert_chain: []
|
|
12
|
-
date: 2016-
|
|
13
|
+
date: 2016-12-01 00:00:00.000000000 Z
|
|
13
14
|
dependencies:
|
|
14
15
|
- !ruby/object:Gem::Dependency
|
|
15
16
|
name: spinjs-rails
|
|
@@ -30,6 +31,7 @@ description: This gem extends formtastic's form builder to support polymoprhic h
|
|
|
30
31
|
email:
|
|
31
32
|
- peter@hyper.no
|
|
32
33
|
- sindre@hyper.no
|
|
34
|
+
- younash@gmail.com
|
|
33
35
|
executables: []
|
|
34
36
|
extensions: []
|
|
35
37
|
extra_rdoc_files: []
|