worker-field-nested_has_many 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa47374ad070ae5bff56a8da43f40b0ffb2234394a748442e4ffde79344460f7
|
4
|
+
data.tar.gz: 23c5152494aac336e9a0373df516fb15361b462b9a75524ffc27df927fbb2ca4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cf7de26afab56e347435fd4b73b2ca5ed3adc1e3c24c3525d57b60aa9be4f4ddcd2fbe1342ad9ab9c9c1f599f5aa36aa7051a178c29116baa8626257021b504
|
7
|
+
data.tar.gz: edf241b80cc3ab6bb51c13590e1338f15f4286d3041cf3a59b195d9781aa501c288ebfc97ec1c7a90db805aa3d428a9401db6b1e84c7622d4dbf35caba8534c7
|
data/README.md
CHANGED
@@ -1,25 +1,91 @@
|
|
1
|
-
# Administrate::Field::NestedHasMany
|
2
1
|
|
3
|
-
|
4
|
-
This Gem is a
|
5
|
-
from the name administrate-field-nested_has_many
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/worker-field-nested_has_many.svg)](https://badge.fury.io/rb/worker-field-nested_has_many)
|
3
|
+
# This Gem is a custom version for a project
|
6
4
|
|
7
|
-
you can get the original one there
|
8
|
-
https://github.com/nickcharlton/administrate-field-nested_has_many
|
9
5
|
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
## Thanks 🙏🏼
|
7
|
+
|
8
|
+
The original and the 99,99997 % is not my
|
13
9
|
|
10
|
+
This awesome Gem is from :
|
14
11
|
|
12
|
+
![@nickcharlton](https://github.com/nickcharlton)
|
13
|
+
![@baldursson](https://github.com/baldursson)
|
14
|
+
![@pablobm](https://github.com/pablobm)
|
15
|
+
![@graysonwright](https://github.com/graysonwright)
|
16
|
+
![@okuramasafumi](https://github.com/okuramasafumi)
|
17
|
+
![@badosu](https://github.com/badosu)
|
15
18
|
|
16
|
-
# Thanks
|
17
19
|
|
18
|
-
|
20
|
+
🙏🏼 🙏🏼 🙏🏼 🙏🏼 🙏🏼 🙏🏼 🙏🏼
|
21
|
+
|
22
|
+
And from also all the huge web discussion
|
23
|
+
|
19
24
|
A huge thank you to Nick Charlton & Grayson Wright !!
|
20
25
|
|
21
|
-
|
26
|
+
### Why a custom version ?
|
27
|
+
|
28
|
+
First, i never did or push any kind of Gems, before. So it was an objectif.
|
29
|
+
Second, this gem is perfect, and i need some more .
|
30
|
+
More specifications inside the form, as class, or ids, or anything that could help me
|
31
|
+
to build a good UX inside forms.
|
32
|
+
|
33
|
+
|
34
|
+
### you are beginner with Gem ?
|
22
35
|
|
23
36
|
here some links...
|
24
37
|
=> create a gem https://goo.gl/kSkKvq
|
25
38
|
=> and when you want to update it https://goo.gl/UoAsJg
|
39
|
+
|
40
|
+
|
41
|
+
# The Original README => Administrate::Field::NestedHasMany
|
42
|
+
|
43
|
+
A plugin for nested has_many forms in [Administrate].
|
44
|
+
|
45
|
+
## Usage
|
46
|
+
|
47
|
+
Add to your `Gemfile`:
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
gem "administrate-field-nested_has_many"
|
51
|
+
```
|
52
|
+
|
53
|
+
Run:
|
54
|
+
|
55
|
+
```bash
|
56
|
+
$ bundle install
|
57
|
+
```
|
58
|
+
|
59
|
+
Add to your `FooDashboard`:
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
ATTRIBUTE_TYPES = {
|
63
|
+
bars: Field::NestedHasMany.with_options(skip: :foo),
|
64
|
+
}
|
65
|
+
```
|
66
|
+
|
67
|
+
The `skip` option takes a single symbol or list of symbols.
|
68
|
+
It will prevent the nested form from displaying the fields for those attributes.
|
69
|
+
|
70
|
+
If a `Customer` `has_many :orders`,
|
71
|
+
and you want to render `orders` as a nested form on the customer edit page,
|
72
|
+
then it is generally necessary to add `skip: :customer` to the options
|
73
|
+
for the `NestedHasMany` field.
|
74
|
+
Otherwise, Administrate will try to render a field
|
75
|
+
for the order's `:customer` attribute,
|
76
|
+
which breaks the nested form logic.
|
77
|
+
|
78
|
+
[Administrate]: https://github.com/thoughtbot/administrate
|
79
|
+
|
80
|
+
|
81
|
+
A plugin for nested has_many forms in [Administrate].
|
82
|
+
This Gem is a specific custmized one form the original one available there
|
83
|
+
from the name administrate-field-nested_has_many
|
84
|
+
|
85
|
+
you can get the original one there
|
86
|
+
https://github.com/nickcharlton/administrate-field-nested_has_many
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
gem "administrate-field-nested_has_many"
|
90
|
+
```
|
91
|
+
[demo]: https://staging-worker-worker.herokuapp.com/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
|
3
|
-
<% if request.env["PATH_INFO"] == "/admin/quotations/new" %>
|
3
|
+
<% if request.env["PATH_INFO"] == "/admin/quotations/new" || "/admin/quotations/edit"%>
|
4
4
|
<div class="nested-fields <%= field.attribute %>"><%# #todo %>
|
5
5
|
<div class="<%= field.attribute.to_s.singularize %>_container <%= field.attribute %>"><%# #todo %>
|
6
6
|
<% field.nested_fields_for_builder(f).each do |attribute| -%>
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "worker-field-nested_has_many"
|
5
5
|
# gem.version = Worker::Field::NestedHasMany::VERSION
|
6
|
-
gem.version = "0.
|
6
|
+
gem.version = "0.3.0"
|
7
7
|
gem.authors = ["v baxter"]
|
8
8
|
gem.email = ["vincent.viricel@gmail.com"]
|
9
9
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: worker-field-nested_has_many
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- v baxter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: administrate
|