draft_generators 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/VERSION +1 -1
- data/draft_generators.gemspec +1 -1
- data/lib/generators/draft/resource/resource_generator.rb +7 -7
- data/lib/generators/draft/resource/templates/controllers/controller.rb +5 -5
- data/lib/generators/draft/resource/templates/views/index.html.erb +38 -120
- data/lib/generators/draft/resource/templates/views/show.html.erb +61 -66
- metadata +2 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b03de9376ab53aee4c6010031bd0b26166d99acf969e033af2e5fd3a7e99b9b8
|
|
4
|
+
data.tar.gz: d243fae3b1682dddff2b7a64ab22f09ba5e777ecd51de7075b4878772528cdaa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 696ed7897525880e7eee749ccb2f7eb0454519511a16f62be649e2ecb78a1e2ffcedf33cad1b20157477f0226577db6436a48e79928a183a3254552b5e9694b4
|
|
7
|
+
data.tar.gz: 6abf61779e1cfb60898d13c0cceffc2144f472d9b16ec8e620dbda16740c8759ae3eedab788a03f30c8f211d440d54144061e84170b42272bed505da384568fc
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.5
|
data/draft_generators.gemspec
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "draft_generators".freeze
|
|
9
|
-
s.version = "0.0.
|
|
9
|
+
s.version = "0.0.5"
|
|
10
10
|
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
|
12
12
|
s.require_paths = ["lib".freeze]
|
|
@@ -32,13 +32,13 @@ module Draft
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def create_root_folder
|
|
35
|
-
empty_directory File.join("app/views", "#{
|
|
35
|
+
empty_directory File.join("app/views", "#{singular_table_name}_templates")
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def generate_view_files
|
|
39
39
|
available_views.each do |view|
|
|
40
40
|
filename = view_filename_with_extensions(view)
|
|
41
|
-
template filename, File.join("app/views", "#{
|
|
41
|
+
template filename, File.join("app/views", "#{singular_table_name}_templates", File.basename(options[:new_form_name].presence || filename))
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
@@ -72,16 +72,16 @@ module Draft
|
|
|
72
72
|
|
|
73
73
|
# CREATE
|
|
74
74
|
post("/insert_#{singular_table_name}", { :controller => "#{plural_table_name}", :action => "create" })
|
|
75
|
-
|
|
75
|
+
|
|
76
76
|
# READ
|
|
77
77
|
get("/#{plural_table_name}", { :controller => "#{plural_table_name}", :action => "index" })
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
get("/#{plural_table_name}/:path_id", { :controller => "#{plural_table_name}", :action => "show" })
|
|
80
|
-
|
|
80
|
+
|
|
81
81
|
# UPDATE
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
post("/modify_#{singular_table_name}/:path_id", { :controller => "#{plural_table_name}", :action => "update" })
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
# DELETE
|
|
86
86
|
get("/delete_#{singular_table_name}/:path_id", { :controller => "#{plural_table_name}", :action => "destroy" })
|
|
87
87
|
|
|
@@ -4,7 +4,7 @@ class <%= plural_table_name.camelize %>Controller < ApplicationController
|
|
|
4
4
|
|
|
5
5
|
@list_of_<%= plural_table_name.underscore %> = matching_<%= plural_table_name.underscore %>.order({ :created_at => :desc })
|
|
6
6
|
|
|
7
|
-
render({ :template => "<%=
|
|
7
|
+
render({ :template => "<%= singular_table_name.underscore %>_templates/index" })
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def show
|
|
@@ -14,7 +14,7 @@ class <%= plural_table_name.camelize %>Controller < ApplicationController
|
|
|
14
14
|
|
|
15
15
|
@the_<%= singular_table_name.underscore %> = matching_<%= plural_table_name.underscore.downcase %>.at(0)
|
|
16
16
|
|
|
17
|
-
render({ :template => "<%=
|
|
17
|
+
render({ :template => "<%= singular_table_name.underscore %>_templates/show" })
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def create
|
|
@@ -62,7 +62,7 @@ class <%= plural_table_name.camelize %>Controller < ApplicationController
|
|
|
62
62
|
<% unless skip_validation_alerts? -%>
|
|
63
63
|
if the_<%= singular_table_name.underscore %>.valid?
|
|
64
64
|
the_<%= singular_table_name.underscore %>.save
|
|
65
|
-
redirect_to("/<%= plural_table_name.underscore %>/#{the_<%= singular_table_name.underscore %>.id}", { :notice => "<%= singular_table_name.humanize %> updated successfully."} )
|
|
65
|
+
redirect_to("/<%= plural_table_name.underscore %>/#{the_<%= singular_table_name.underscore %>.id}", { :notice => "<%= singular_table_name.humanize %> updated successfully." } )
|
|
66
66
|
else
|
|
67
67
|
redirect_to("/<%= plural_table_name.underscore %>/#{the_<%= singular_table_name.underscore %>.id}", { :alert => the_<%= singular_table_name.underscore %>.errors.full_messages.to_sentence })
|
|
68
68
|
end
|
|
@@ -72,7 +72,7 @@ class <%= plural_table_name.camelize %>Controller < ApplicationController
|
|
|
72
72
|
<% unless skip_redirect? -%>
|
|
73
73
|
redirect_to("/<%= plural_table_name.underscore %>/#{the_<%= singular_table_name.underscore %>.id}")
|
|
74
74
|
<% else -%>
|
|
75
|
-
render({ :template => "<%=
|
|
75
|
+
render({ :template => "<%= singular_table_name.underscore %>_templates/show" })
|
|
76
76
|
<% end -%>
|
|
77
77
|
<% end -%>
|
|
78
78
|
end
|
|
@@ -84,7 +84,7 @@ class <%= plural_table_name.camelize %>Controller < ApplicationController
|
|
|
84
84
|
the_<%= singular_table_name.underscore %>.destroy
|
|
85
85
|
|
|
86
86
|
<% unless skip_validation_alerts? -%>
|
|
87
|
-
redirect_to("/<%= plural_table_name.underscore %>", { :notice => "<%= singular_table_name.humanize %> deleted successfully."} )
|
|
87
|
+
redirect_to("/<%= plural_table_name.underscore %>", { :notice => "<%= singular_table_name.humanize %> deleted successfully." } )
|
|
88
88
|
<% else -%>
|
|
89
89
|
<% unless skip_redirect? -%>
|
|
90
90
|
redirect_to("/<%= plural_table_name.underscore %>")
|
|
@@ -1,148 +1,66 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
List of all <%= plural_table_name.humanize.downcase %>
|
|
5
|
-
</h1>
|
|
6
|
-
</div>
|
|
7
|
-
</div>
|
|
1
|
+
<h1>
|
|
2
|
+
List of all <%= plural_table_name.humanize.downcase %>
|
|
3
|
+
</h1>
|
|
8
4
|
|
|
9
5
|
<hr>
|
|
10
6
|
|
|
11
|
-
<
|
|
12
|
-
<
|
|
7
|
+
<article>
|
|
8
|
+
<header>
|
|
13
9
|
<h2>
|
|
14
10
|
Add a new <%= singular_table_name.humanize.downcase %>
|
|
15
11
|
</h2>
|
|
12
|
+
</header>
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
<form action="/insert_<%= singular_table_name %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
18
15
|
<% attributes.each do |attribute| -%>
|
|
19
16
|
<% if attribute.field_type == :check_box -%>
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
<div>
|
|
18
|
+
<input type="checkbox" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>" value="1">
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
<label for="<%= attribute.column_name %>_box"><%= attribute.column_name.humanize %></label>
|
|
21
|
+
</div>
|
|
25
22
|
|
|
26
23
|
<% else -%>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
<div>
|
|
25
|
+
<label for="<%= attribute.column_name %>_box">
|
|
26
|
+
<%= attribute.column_name.humanize %>
|
|
27
|
+
</label>
|
|
31
28
|
|
|
32
29
|
<% if attribute.field_type == :text_area -%>
|
|
33
|
-
|
|
30
|
+
<textarea id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>" rows="3"></textarea>
|
|
34
31
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :datetime -%>
|
|
35
|
-
|
|
32
|
+
<input type="datetime-local" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>">
|
|
36
33
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :date -%>
|
|
37
|
-
|
|
34
|
+
<input type="date" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>">
|
|
38
35
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :time -%>
|
|
39
|
-
|
|
36
|
+
<input type="time" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>">
|
|
40
37
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :integer -%>
|
|
41
|
-
|
|
38
|
+
<input type="number" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>">
|
|
42
39
|
<% else -%>
|
|
43
|
-
|
|
40
|
+
<input type="text" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>">
|
|
44
41
|
<% end -%>
|
|
45
|
-
|
|
42
|
+
</div>
|
|
46
43
|
|
|
47
44
|
<% end -%>
|
|
48
45
|
<% end -%>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</div>
|
|
46
|
+
<button type="submit">
|
|
47
|
+
Create <%= singular_table_name.humanize.downcase %>
|
|
48
|
+
</button>
|
|
49
|
+
</form>
|
|
50
|
+
</article>
|
|
55
51
|
|
|
56
52
|
<hr>
|
|
57
|
-
<% if with_sentinels? -%>
|
|
58
|
-
<!-- Ransack Code start -->
|
|
59
53
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<table border="1">
|
|
72
|
-
<tr>
|
|
73
|
-
<th>
|
|
74
|
-
ID
|
|
75
|
-
</th>
|
|
76
|
-
|
|
77
|
-
<% attributes.each do |attribute| -%>
|
|
78
|
-
<th>
|
|
79
|
-
<%= attribute.human_name %>
|
|
80
|
-
</th>
|
|
81
|
-
|
|
82
|
-
<% end -%>
|
|
83
|
-
<th>
|
|
84
|
-
Created at
|
|
85
|
-
</th>
|
|
86
|
-
|
|
87
|
-
<th>
|
|
88
|
-
Updated at
|
|
89
|
-
</th>
|
|
90
|
-
|
|
91
|
-
<th>
|
|
92
|
-
</th>
|
|
93
|
-
</tr>
|
|
94
|
-
|
|
95
|
-
<%% @list_of_<%= plural_table_name %>.each do |<%= singular_table_name.indefinitize.gsub(" ", "_") %>| %>
|
|
96
|
-
<tr>
|
|
97
|
-
<% if with_sentinels? -%>
|
|
98
|
-
<!-- Display <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id start -->
|
|
99
|
-
<% end -%>
|
|
100
|
-
<td>
|
|
101
|
-
<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id %>
|
|
102
|
-
</td>
|
|
103
|
-
<% if with_sentinels? -%>
|
|
104
|
-
<!-- Display <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id end -->
|
|
105
|
-
<% end -%>
|
|
106
|
-
|
|
107
|
-
<% attributes.each do |attribute| -%>
|
|
108
|
-
<% if with_sentinels? -%>
|
|
109
|
-
<!-- Display <%= singular_table_name.indefinitize.gsub(" ", "_") %>.<%= attribute.column_name %> start -->
|
|
110
|
-
<% end -%>
|
|
111
|
-
<td>
|
|
112
|
-
<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.<%= attribute.column_name %> %>
|
|
113
|
-
</td>
|
|
114
|
-
<% if with_sentinels? -%>
|
|
115
|
-
<!-- Display <%= singular_table_name.indefinitize.gsub(" ", "_") %>.<%= attribute.column_name %> end -->
|
|
116
|
-
<% end -%>
|
|
117
|
-
|
|
118
|
-
<% end -%>
|
|
119
|
-
<% if with_sentinels? -%>
|
|
120
|
-
<!-- Display <%= singular_table_name.indefinitize.gsub(" ", "_") %>.created_at start -->
|
|
121
|
-
<% end -%>
|
|
122
|
-
<td>
|
|
123
|
-
<%%= time_ago_in_words(<%= singular_table_name.indefinitize.gsub(" ", "_") %>.created_at) %> ago
|
|
124
|
-
</td>
|
|
125
|
-
<% if with_sentinels? -%>
|
|
126
|
-
<!-- Display <%= singular_table_name.indefinitize.gsub(" ", "_") %>.created_at end -->
|
|
127
|
-
|
|
128
|
-
<!-- Display <%= singular_table_name.indefinitize.gsub(" ", "_") %>.updated_at start -->
|
|
129
|
-
<% end -%>
|
|
130
|
-
<td>
|
|
131
|
-
<%%= time_ago_in_words(<%= singular_table_name.indefinitize.gsub(" ", "_") %>.updated_at) %> ago
|
|
132
|
-
</td>
|
|
133
|
-
<% if with_sentinels? -%>
|
|
134
|
-
<!-- Display <%= singular_table_name.indefinitize.gsub(" ", "_") %>.updated_at end -->
|
|
135
|
-
<% end -%>
|
|
136
|
-
|
|
137
|
-
<td>
|
|
138
|
-
<a href="/<%= plural_table_name %>/<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id %>">
|
|
139
|
-
Show details
|
|
140
|
-
</a>
|
|
141
|
-
</td>
|
|
142
|
-
</tr>
|
|
143
|
-
<%% end %>
|
|
144
|
-
</table>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
54
|
+
<article>
|
|
55
|
+
<ul>
|
|
56
|
+
<%% @list_of_<%= plural_table_name %>.each do |<%= singular_table_name.indefinitize.gsub(" ", "_") %>| %>
|
|
57
|
+
<li>
|
|
58
|
+
<a href="/<%= plural_table_name.underscore %>/<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id %>">
|
|
59
|
+
<%= singular_table_name.humanize %> #<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id %>
|
|
60
|
+
</a>
|
|
61
|
+
</li>
|
|
62
|
+
<%% end %>
|
|
63
|
+
</ul>
|
|
64
|
+
</article>
|
|
147
65
|
|
|
148
66
|
<hr>
|
|
@@ -1,75 +1,70 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<%= singular_table_name.humanize %> #<%%= @the_<%= singular_table_name %>.id %> details
|
|
5
|
-
</h1>
|
|
1
|
+
<h1>
|
|
2
|
+
<%= singular_table_name.humanize %> #<%%= @the_<%= singular_table_name %>.id %> details
|
|
3
|
+
</h1>
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
<article>
|
|
6
|
+
<div>
|
|
7
|
+
<a href="/<%= plural_table_name %>">
|
|
8
|
+
Go back
|
|
9
|
+
</a>
|
|
10
|
+
</div>
|
|
13
11
|
|
|
14
12
|
<% unless read_only? -%>
|
|
15
13
|
<% if with_sentinels? -%>
|
|
16
14
|
<!-- Delete link <%= singular_table_name %> start -->
|
|
17
15
|
<% end -%>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
<div>
|
|
17
|
+
<a href="/delete_<%= singular_table_name %>/<%%= @the_<%= singular_table_name %>.id %>">
|
|
18
|
+
Delete <%= singular_table_name.humanize.downcase %>
|
|
19
|
+
</a>
|
|
20
|
+
</div>
|
|
23
21
|
<% if with_sentinels? -%>
|
|
24
22
|
<!-- Delete link <%= singular_table_name %> end -->
|
|
25
23
|
<% end -%>
|
|
26
24
|
<% end -%>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<dl>
|
|
25
|
+
<dl>
|
|
30
26
|
<% attributes.each do |attribute| -%>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
<dt>
|
|
28
|
+
<%= attribute.human_name %>
|
|
29
|
+
</dt>
|
|
34
30
|
<% if with_sentinels? -%>
|
|
35
31
|
<!-- Display the_<%= attribute.column_name %> start -->
|
|
36
32
|
<% end -%>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
<dd>
|
|
34
|
+
<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>
|
|
35
|
+
</dd>
|
|
40
36
|
<% if with_sentinels? -%>
|
|
41
37
|
<!-- Display the_<%= attribute.column_name %> end -->
|
|
42
38
|
<% end -%>
|
|
43
39
|
|
|
44
40
|
<% end -%>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
<dt>
|
|
42
|
+
Created at
|
|
43
|
+
</dt>
|
|
48
44
|
<% if with_sentinels? -%>
|
|
49
45
|
<!-- Display created_at start -->
|
|
50
46
|
<% end -%>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
<dd>
|
|
48
|
+
<%%= time_ago_in_words(@the_<%= singular_table_name %>.created_at) %> ago
|
|
49
|
+
</dd>
|
|
54
50
|
<% if with_sentinels? -%>
|
|
55
51
|
<!-- Display created_at end -->
|
|
56
52
|
<% end -%>
|
|
57
53
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
<dt>
|
|
55
|
+
Updated at
|
|
56
|
+
</dt>
|
|
61
57
|
<% if with_sentinels? -%>
|
|
62
58
|
<!-- Display updated_at start -->
|
|
63
59
|
<% end -%>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
<dd>
|
|
61
|
+
<%%= time_ago_in_words(@the_<%= singular_table_name %>.updated_at) %> ago
|
|
62
|
+
</dd>
|
|
67
63
|
<% if with_sentinels? -%>
|
|
68
64
|
<!-- Display updated_at end -->
|
|
69
65
|
<% end -%>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
</div>
|
|
66
|
+
</dl>
|
|
67
|
+
</article>
|
|
73
68
|
|
|
74
69
|
<hr>
|
|
75
70
|
|
|
@@ -79,52 +74,52 @@
|
|
|
79
74
|
<!-- Show Page Customization end -->
|
|
80
75
|
<% end -%>
|
|
81
76
|
|
|
82
|
-
<
|
|
83
|
-
<
|
|
77
|
+
<article>
|
|
78
|
+
<header>
|
|
84
79
|
<h2>
|
|
85
80
|
Edit <%= singular_table_name.humanize.downcase %>
|
|
86
81
|
</h2>
|
|
82
|
+
</header>
|
|
87
83
|
|
|
88
|
-
|
|
84
|
+
<form action="/modify_<%= singular_table_name %>/<%%= @the_<%= singular_table_name %>.id %>" <% unless skip_post? -%> method="post" <% end -%>>
|
|
89
85
|
<% attributes.each do |attribute| -%>
|
|
90
86
|
<% if attribute.field_type == :check_box -%>
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
<div>
|
|
88
|
+
<input type="checkbox" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>" value="1" <%%= "checked" if @the_<%= singular_table_name %>.<%= attribute.column_name %> %>>
|
|
93
89
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
<label for="<%= attribute.column_name %>_box">
|
|
91
|
+
<%= attribute.column_name.humanize %>
|
|
92
|
+
</label>
|
|
93
|
+
</div>
|
|
98
94
|
|
|
99
95
|
<% else -%>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
<div>
|
|
97
|
+
<label for="<%= attribute.column_name %>_box">
|
|
98
|
+
<%= attribute.column_name.humanize %>
|
|
99
|
+
</label>
|
|
104
100
|
|
|
105
101
|
<% if attribute.field_type == :text_area -%>
|
|
106
|
-
|
|
102
|
+
<textarea id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>"><%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
|
|
107
103
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :datetime -%>
|
|
108
|
-
|
|
104
|
+
<input type="datetime-local" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>"
|
|
109
105
|
value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
|
|
110
106
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :date -%>
|
|
111
|
-
|
|
107
|
+
<input type="date" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>" value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
|
|
112
108
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :time -%>
|
|
113
|
-
|
|
109
|
+
<input type="time" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>" value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
|
|
114
110
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :integer -%>
|
|
115
|
-
|
|
111
|
+
<input type="number" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>" value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
|
|
116
112
|
<% else -%>
|
|
117
|
-
|
|
113
|
+
<input type="text" id="<%= attribute.column_name %>_box" name="query_<%= attribute.column_name %>" value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
|
|
118
114
|
<% end -%>
|
|
119
|
-
|
|
115
|
+
</div>
|
|
120
116
|
|
|
121
117
|
<% end -%>
|
|
122
118
|
<% end -%>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</div>
|
|
119
|
+
<button type="submit">
|
|
120
|
+
Update <%= singular_table_name.humanize.downcase %>
|
|
121
|
+
</button>
|
|
122
|
+
</form>
|
|
123
|
+
</article>
|
|
129
124
|
|
|
130
125
|
<hr>
|
metadata
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: draft_generators
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Raghu Betina
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
10
|
date: 2023-05-30 00:00:00.000000000 Z
|
|
@@ -194,7 +193,6 @@ homepage: http://github.com/raghubetina/draft_generators
|
|
|
194
193
|
licenses:
|
|
195
194
|
- MIT
|
|
196
195
|
metadata: {}
|
|
197
|
-
post_install_message:
|
|
198
196
|
rdoc_options: []
|
|
199
197
|
require_paths:
|
|
200
198
|
- lib
|
|
@@ -209,8 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
209
207
|
- !ruby/object:Gem::Version
|
|
210
208
|
version: '0'
|
|
211
209
|
requirements: []
|
|
212
|
-
rubygems_version: 3.
|
|
213
|
-
signing_key:
|
|
210
|
+
rubygems_version: 3.6.5
|
|
214
211
|
specification_version: 4
|
|
215
212
|
summary: Generators that help beginners learn to program.
|
|
216
213
|
test_files: []
|