tybo 0.0.4 → 0.0.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 +4 -4
- data/lib/generators/bo/bo_generator.rb +1 -1
- data/lib/generators/bo/templates/_form.html.erb +6 -6
- data/lib/tybo/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: 91fb59c76c56ea609b93d85cca672305dac0a42875fbd9da8a1b68340c8c5680
|
4
|
+
data.tar.gz: acb7e7c3f088b8db387a35c16ec066c083d96fee5635ebb277fe4badddc07db5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 659f38ba69978f6963f0fe16fdde1e25fbb648473ad69026225a230677865dec508fd2aa25d4bf822a57f035816bb772153ae2ae20055da508f08145bc23f4c4
|
7
|
+
data.tar.gz: 4a9fefbf4ca44927feadda09778bc2a8cf68a9602273e11f9a62974af664ee835bf492a58b0bbc91a6feac5d882c084d0c0281d1a6d38752eb09b95259ab4430
|
@@ -59,7 +59,7 @@ class BoGenerator < Rails::Generators::NamedBase
|
|
59
59
|
params["#{col.name.to_s.remove('rich_text_' )}".to_sym] = nil
|
60
60
|
end
|
61
61
|
has_many_assoc&.map do |association|
|
62
|
-
params["#{association.
|
62
|
+
params["#{association.name.to_s.singularize}_ids".to_sym] = []
|
63
63
|
end
|
64
64
|
params
|
65
65
|
end
|
@@ -6,23 +6,23 @@
|
|
6
6
|
<%- end -%>
|
7
7
|
<!-- belongs_to Associations -->
|
8
8
|
<%- belongs_to_assoc.each do |association| -%>
|
9
|
-
<%%= f.association :<%= association.name %>, collection: <%= association.
|
9
|
+
<%%= f.association :<%= association.name.to_s.singularize %>, collection: <%= association.klass.name %>.all.map { |item| [item.<%=bo_model_title(association.klass.name.constantize)%>, item.id] } %>
|
10
10
|
<%- end -%>
|
11
11
|
<!-- has_one Associations -->
|
12
12
|
<%- has_one_assoc.each do |association| -%>
|
13
13
|
<%- if association.options[:class_name] == "ActionText::RichText" -%>
|
14
|
-
<%%= f.rich_text_area :<%= association.name.to_s.remove('rich_text_' )%> %>
|
14
|
+
<%%= f.rich_text_area :<%= association.name.to_s.singularize.to_s.remove('rich_text_' )%> %>
|
15
15
|
<%- else -%>
|
16
|
-
<%%= f.input :<%= association.foreign_key %>, collection: <%= association.
|
16
|
+
<%%= f.input :<%= association.foreign_key %>, collection: <%= association.klass.name %>.all.map { |item| [item.<%=bo_model_title(association.klass.name.constantize)%>, item.id] } %>
|
17
17
|
<%- end -%>
|
18
18
|
<%- end -%>
|
19
19
|
|
20
20
|
<!-- has_many Associations -->
|
21
21
|
<%- has_many_assoc.each do |association| -%>
|
22
22
|
<div class="my-5 select">
|
23
|
-
<label class="block text-sm font-medium text-gray-700 string optional text-sm font-medium text-gray-600" for="<%= "#{class_name.underscore}_#{association.
|
24
|
-
<%%= f.select :<%= "#{association.
|
25
|
-
<%= association.
|
23
|
+
<label class="block text-sm font-medium text-gray-700 string optional text-sm font-medium text-gray-600" for="<%= "#{class_name.underscore}_#{association.name.to_s.singularize}_ids" %>"><%= association.name.to_s.singularize%></label>
|
24
|
+
<%%= f.select :<%= "#{association.name.to_s.singularize}_ids" %>,
|
25
|
+
<%= association.klass.name %>.all.map { |item| [item.<%=bo_model_title(association.klass.name.constantize)%>, item.id] },
|
26
26
|
{ include_blank: true },
|
27
27
|
multiple: true,
|
28
28
|
data: { controller: 'ts--select' } %>
|
data/lib/tybo/version.rb
CHANGED