vue_crud-generator 0.1.0 → 0.1.1
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: 72b24f52c568de5b1fc0fbd80b59b6ce1482146593b3484018c6c4a62030b8bd
|
4
|
+
data.tar.gz: bd62bab6ba90ffa3d1d090c10bbeaea0e71a9e8ae270c96ce7b70eeb115fdaca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71b1f115245c181b04d4ca61b3cb49a7c320f333b74dec87c2f5d56391ddfacd1158572aca21a0f53a14f18aea27c0c0e34c1432d2d597b0b959e50d3c2d5b91
|
7
|
+
data.tar.gz: 0bb037e2e4340ca2dfe99a350e687db8f76ef9f5ee759332ae1037c7f47009b75313e9e2fd02a5958511d46619404ceec6d87e403a4a81ea96d88ea02d8ffb9d
|
@@ -22,11 +22,10 @@
|
|
22
22
|
<%= primary_key_name.capitalize %> {{editedItem.<%= primary_key_name %>}}
|
23
23
|
</div>
|
24
24
|
<%= attributes_names_without_id.map { |name| (<<-JS).strip }.join("\n#{' ' * 26}")
|
25
|
-
|
25
|
+
<v-flex xs12 sm12 md12>
|
26
26
|
<v-text-field v-model="editedItem.#{name}" label="#{name.capitalize}" />
|
27
|
-
|
28
|
-
|
29
|
-
%>
|
27
|
+
</v-flex>
|
28
|
+
JS%>
|
30
29
|
</v-layout>
|
31
30
|
</v-container>
|
32
31
|
</v-card-text>
|
@@ -85,8 +84,8 @@
|
|
85
84
|
},
|
86
85
|
|
87
86
|
close() {
|
88
|
-
this.resetToDefault();
|
89
87
|
this.dialog = false;
|
88
|
+
this.resetToDefault();
|
90
89
|
},
|
91
90
|
|
92
91
|
errorHandler(error) {
|
@@ -164,9 +163,10 @@
|
|
164
163
|
return {
|
165
164
|
defaultItem: {
|
166
165
|
// you can add default values for your attributes here
|
167
|
-
<%=
|
166
|
+
<%= render_attributes_defaults(10) %>
|
168
167
|
},
|
169
168
|
editedItem: {
|
169
|
+
<%= render_attributes_defaults(10) %>
|
170
170
|
},
|
171
171
|
editedId: -1,
|
172
172
|
errorSnackbar: false,
|
@@ -14,6 +14,10 @@ module VueJs
|
|
14
14
|
attributes_without_id.map(&:name)
|
15
15
|
end
|
16
16
|
|
17
|
+
def render_attributes_defaults(indentation)
|
18
|
+
attributes_names_without_id.map {|name| "#{name}: null" }.join(",\n#{' ' * indentation}")
|
19
|
+
end
|
20
|
+
|
17
21
|
def attributes_without_id
|
18
22
|
@attributes_without_id ||= attributes.reject {|attr| attr.type == :primary_key}
|
19
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vue_crud-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Senya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|