draft_generators 0.0.6 → 0.0.7
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/templates/views/association_new_form.html.erb +1 -1
- data/lib/generators/draft/resource/templates/views/create_row.html.erb +23 -10
- data/lib/generators/draft/resource/templates/views/destroy_row.html.erb +23 -10
- data/lib/generators/draft/resource/templates/views/edit_form.html.erb +42 -39
- data/lib/generators/draft/resource/templates/views/edit_form_with_errors.html.erb +44 -41
- data/lib/generators/draft/resource/templates/views/index.html.erb +18 -22
- data/lib/generators/draft/resource/templates/views/new_form.html.erb +42 -40
- data/lib/generators/draft/resource/templates/views/new_form_with_errors.html.erb +44 -42
- data/lib/generators/draft/resource/templates/views/show.html.erb +40 -39
- data/lib/generators/draft/resource/templates/views/update_row.html.erb +20 -7
- 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: 3354edf9392d768ed4b0651cbe2e417282b0938f310081559c1730ffd8f4fdb2
|
|
4
|
+
data.tar.gz: 5cebddd1e8e7920e28fa3b5ca8895bc4eb7b75b39ff8aa10f3930b3b7aaf4639
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e2bb35a35b221cd8f1bdb9939e4e9df456dd8bd74fe2cbc105b4ae48bb21f50cb3b58cab84a5d967a3d67417c5097b247f24753f198097d5e798cd09cd1d3a15
|
|
7
|
+
data.tar.gz: 923249f07997b666c50aa0dc05dc56ad8bac9dcc7c6068c9079e7dfd557bdfc4ea867ecc1e4e77d42bfcb2ebe0753383e0817f19fd5184c811cc0193b094a281
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.7
|
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.7"
|
|
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]
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
<
|
|
1
|
+
<nav aria-label="breadcrumb">
|
|
2
|
+
<ul>
|
|
3
|
+
<li><a href="/<%= plural_table_name.underscore %>"><%= plural_table_name.humanize %></a></li>
|
|
4
|
+
<li><%= singular_table_name.humanize %> #<%%= @<%= singular_table_name %>.id %></li>
|
|
5
|
+
</ul>
|
|
6
|
+
</nav>
|
|
2
7
|
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
<div class="card">
|
|
9
|
+
<header>
|
|
10
|
+
<h1>
|
|
11
|
+
You created <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>!
|
|
12
|
+
</h1>
|
|
13
|
+
</header>
|
|
6
14
|
|
|
7
|
-
<p>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</a>
|
|
15
|
+
<p>
|
|
16
|
+
There are now <%%= @current_count %> <%= plural_table_name.humanize.downcase %>.
|
|
17
|
+
</p>
|
|
11
18
|
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
<p>
|
|
20
|
+
<a href="/<%= plural_table_name.underscore %>">
|
|
21
|
+
Click here
|
|
22
|
+
</a>
|
|
23
|
+
|
|
24
|
+
to go back.
|
|
25
|
+
</p>
|
|
26
|
+
</div>
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
<
|
|
1
|
+
<nav aria-label="breadcrumb">
|
|
2
|
+
<ul>
|
|
3
|
+
<li><a href="/<%= plural_table_name.underscore %>"><%= plural_table_name.humanize %></a></li>
|
|
4
|
+
<li><%= singular_table_name.humanize %> #<%%= @<%= singular_table_name %>.id %></li>
|
|
5
|
+
</ul>
|
|
6
|
+
</nav>
|
|
2
7
|
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
<div class="card">
|
|
9
|
+
<header>
|
|
10
|
+
<h1>
|
|
11
|
+
You deleted <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>!
|
|
12
|
+
</h1>
|
|
13
|
+
</header>
|
|
6
14
|
|
|
7
|
-
<p>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</a>
|
|
15
|
+
<p>
|
|
16
|
+
There are now <%%= @remaining_count %> <%= plural_table_name.humanize.downcase %>.
|
|
17
|
+
</p>
|
|
11
18
|
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
<p>
|
|
20
|
+
<a href="/<%= plural_table_name.underscore %>">
|
|
21
|
+
Click here
|
|
22
|
+
</a>
|
|
23
|
+
|
|
24
|
+
to go back.
|
|
25
|
+
</p>
|
|
26
|
+
</div>
|
|
@@ -1,72 +1,75 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<nav aria-label="breadcrumb">
|
|
2
|
+
<ul>
|
|
3
|
+
<li><a href="/<%= plural_table_name %>"><%= plural_table_name.humanize %></a></li>
|
|
4
|
+
<li>Edit <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %></li>
|
|
5
|
+
</ul>
|
|
6
|
+
</nav>
|
|
4
7
|
|
|
5
|
-
<
|
|
8
|
+
<div class="card">
|
|
9
|
+
<header>
|
|
10
|
+
<h1>
|
|
11
|
+
Edit <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>
|
|
12
|
+
</h1>
|
|
13
|
+
</header>
|
|
6
14
|
|
|
7
15
|
<% if with_sentinels? -%>
|
|
8
|
-
<!-- Form <%= singular_table_name %> start -->
|
|
16
|
+
<!-- Form <%= singular_table_name %> start -->
|
|
9
17
|
<% end -%>
|
|
10
|
-
<form action="/update_<%= singular_table_name %>/<%%= @<%= singular_table_name %>.id %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
18
|
+
<form action="/update_<%= singular_table_name %>/<%%= @<%= singular_table_name %>.id %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
11
19
|
<% if with_sentinels? -%>
|
|
12
|
-
<!-- Form <%= singular_table_name %> end -->
|
|
20
|
+
<!-- Form <%= singular_table_name %> end -->
|
|
13
21
|
<% end -%>
|
|
14
22
|
|
|
15
23
|
<% attributes.each do |attribute| -%>
|
|
16
24
|
<% if with_sentinels? -%>
|
|
17
|
-
|
|
25
|
+
<!-- Label and input for <%= attribute.column_name %> start -->
|
|
18
26
|
<% end -%>
|
|
19
27
|
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
<div>
|
|
29
|
+
<input type="hidden" value="0" name="<%= attribute.column_name %>_param">
|
|
22
30
|
<% if with_sentinels? -%>
|
|
23
|
-
|
|
31
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
24
32
|
<% end -%>
|
|
25
|
-
|
|
33
|
+
<input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" value="1" <%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %>>
|
|
26
34
|
<% if with_sentinels? -%>
|
|
27
|
-
|
|
35
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
28
36
|
<% end -%>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
<label for="<%= attribute.column_name %>_field">
|
|
38
|
+
<%= attribute.column_name.humanize %>
|
|
39
|
+
</label>
|
|
40
|
+
</div>
|
|
33
41
|
<% else -%>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
<div>
|
|
43
|
+
<label for="<%= attribute.column_name %>_field">
|
|
44
|
+
<%= attribute.column_name.humanize %>
|
|
45
|
+
</label>
|
|
38
46
|
|
|
39
47
|
<% if [:text_area, :textarea].include?(attribute.field_type) -%>
|
|
40
48
|
<% if with_sentinels? -%>
|
|
41
|
-
|
|
49
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
42
50
|
<% end -%>
|
|
43
|
-
|
|
51
|
+
<textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
|
|
44
52
|
<% if with_sentinels? -%>
|
|
45
|
-
|
|
53
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
46
54
|
<% end -%>
|
|
47
55
|
<% else -%>
|
|
48
56
|
<% if with_sentinels? -%>
|
|
49
|
-
|
|
57
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
50
58
|
<% end -%>
|
|
51
|
-
|
|
59
|
+
<input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>">
|
|
52
60
|
<% if with_sentinels? -%>
|
|
53
|
-
|
|
61
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
54
62
|
<% end -%>
|
|
55
63
|
<% end -%>
|
|
56
|
-
|
|
64
|
+
</div>
|
|
57
65
|
<% if with_sentinels? -%>
|
|
58
|
-
|
|
66
|
+
<!-- Label and input for <%= attribute.column_name %> end -->
|
|
59
67
|
<% end -%>
|
|
60
68
|
<% end -%>
|
|
61
69
|
|
|
62
70
|
<% end -%>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
</form>
|
|
67
|
-
|
|
68
|
-
<hr>
|
|
69
|
-
|
|
70
|
-
<a href="/<%= plural_table_name %>">
|
|
71
|
-
Go back
|
|
72
|
-
</a>
|
|
71
|
+
<button type="submit">
|
|
72
|
+
Update <%= singular_table_name.humanize.downcase %>
|
|
73
|
+
</button>
|
|
74
|
+
</form>
|
|
75
|
+
</div>
|
|
@@ -1,85 +1,88 @@
|
|
|
1
|
+
<nav aria-label="breadcrumb">
|
|
2
|
+
<ul>
|
|
3
|
+
<li><a href="/<%= plural_table_name %>"><%= plural_table_name.humanize %></a></li>
|
|
4
|
+
<li>Edit <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %></li>
|
|
5
|
+
</ul>
|
|
6
|
+
</nav>
|
|
7
|
+
|
|
1
8
|
<% unless skip_validation_alerts? -%>
|
|
2
9
|
<% if with_sentinels? -%>
|
|
3
10
|
<!-- Validation failure messages -->
|
|
4
11
|
<% end -%>
|
|
5
12
|
<%% if @<%= singular_table_name %>.errors.any? %>
|
|
6
13
|
<%% @<%= singular_table_name %>.errors.full_messages.each do |message| %>
|
|
7
|
-
<div>
|
|
14
|
+
<div class="text-red-600">
|
|
8
15
|
<%%= message %>
|
|
9
16
|
</div>
|
|
10
17
|
<%% end %>
|
|
11
18
|
<%% end %>
|
|
12
19
|
|
|
13
20
|
<% end -%>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
<div class="card">
|
|
22
|
+
<header>
|
|
23
|
+
<h1>
|
|
24
|
+
Edit <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>
|
|
25
|
+
</h1>
|
|
26
|
+
</header>
|
|
19
27
|
|
|
20
28
|
<% if with_sentinels? -%>
|
|
21
|
-
<!-- Form <%= singular_table_name %> start -->
|
|
29
|
+
<!-- Form <%= singular_table_name %> start -->
|
|
22
30
|
<% end -%>
|
|
23
|
-
<form action="/update_<%= singular_table_name %>/<%%= @<%= singular_table_name %>.id %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
31
|
+
<form action="/update_<%= singular_table_name %>/<%%= @<%= singular_table_name %>.id %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
24
32
|
<% if with_sentinels? -%>
|
|
25
|
-
<!-- Form <%= singular_table_name %> end -->
|
|
33
|
+
<!-- Form <%= singular_table_name %> end -->
|
|
26
34
|
<% end -%>
|
|
27
35
|
|
|
28
36
|
<% attributes.each do |attribute| -%>
|
|
29
37
|
<% if with_sentinels? -%>
|
|
30
|
-
|
|
38
|
+
<!-- Label and input for <%= attribute.column_name %> start -->
|
|
31
39
|
<% end -%>
|
|
32
40
|
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
<div>
|
|
42
|
+
<input type="hidden" value="0" name="<%= attribute.column_name %>_param">
|
|
35
43
|
<% if with_sentinels? -%>
|
|
36
|
-
|
|
44
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
37
45
|
<% end -%>
|
|
38
|
-
|
|
46
|
+
<input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" value="1" <%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %>>
|
|
39
47
|
<% if with_sentinels? -%>
|
|
40
|
-
|
|
48
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
41
49
|
<% end -%>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
<label for="<%= attribute.column_name %>_field">
|
|
51
|
+
<%= attribute.column_name.humanize %>
|
|
52
|
+
</label>
|
|
53
|
+
</div>
|
|
46
54
|
<% else -%>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
<div>
|
|
56
|
+
<label for="<%= attribute.column_name %>_field">
|
|
57
|
+
<%= attribute.column_name.humanize %>
|
|
58
|
+
</label>
|
|
51
59
|
|
|
52
60
|
<% if [:text_area, :textarea].include?(attribute.field_type) -%>
|
|
53
61
|
<% if with_sentinels? -%>
|
|
54
|
-
|
|
62
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
55
63
|
<% end -%>
|
|
56
|
-
|
|
64
|
+
<textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
|
|
57
65
|
<% if with_sentinels? -%>
|
|
58
|
-
|
|
66
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
59
67
|
<% end -%>
|
|
60
68
|
<% else -%>
|
|
61
69
|
<% if with_sentinels? -%>
|
|
62
|
-
|
|
70
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
63
71
|
<% end -%>
|
|
64
|
-
|
|
72
|
+
<input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>">
|
|
65
73
|
<% if with_sentinels? -%>
|
|
66
|
-
|
|
74
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
67
75
|
<% end -%>
|
|
68
76
|
<% end -%>
|
|
69
|
-
|
|
77
|
+
</div>
|
|
70
78
|
<% if with_sentinels? -%>
|
|
71
|
-
|
|
79
|
+
<!-- Label and input for <%= attribute.column_name %> end -->
|
|
72
80
|
<% end -%>
|
|
73
81
|
<% end -%>
|
|
74
82
|
|
|
75
83
|
<% end -%>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</form>
|
|
80
|
-
|
|
81
|
-
<hr>
|
|
82
|
-
|
|
83
|
-
<a href="/<%= plural_table_name %>">
|
|
84
|
-
Go back
|
|
85
|
-
</a>
|
|
84
|
+
<button type="submit">
|
|
85
|
+
Update <%= singular_table_name.humanize.downcase %>
|
|
86
|
+
</button>
|
|
87
|
+
</form>
|
|
88
|
+
</div>
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<div class="card">
|
|
2
|
+
<header>
|
|
3
|
+
<h1>
|
|
4
|
+
List of all <%= plural_table_name.humanize.downcase %>
|
|
5
|
+
</h1>
|
|
6
|
+
</header>
|
|
4
7
|
|
|
5
|
-
<
|
|
8
|
+
<ul>
|
|
9
|
+
<%% @list_of_<%= plural_table_name %>.each do |<%= singular_table_name.indefinitize.gsub(" ", "_") %>| %>
|
|
10
|
+
<li>
|
|
11
|
+
<a href="/<%= plural_table_name.underscore %>/<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id %>">
|
|
12
|
+
<%= singular_table_name.humanize %> #<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id %>
|
|
13
|
+
</a>
|
|
14
|
+
</li>
|
|
15
|
+
<%% end %>
|
|
16
|
+
</ul>
|
|
17
|
+
</div>
|
|
6
18
|
|
|
7
|
-
<
|
|
19
|
+
<div class="card">
|
|
8
20
|
<header>
|
|
9
21
|
<h2>
|
|
10
22
|
Add a new <%= singular_table_name.humanize.downcase %>
|
|
@@ -47,20 +59,4 @@
|
|
|
47
59
|
Create <%= singular_table_name.humanize.downcase %>
|
|
48
60
|
</button>
|
|
49
61
|
</form>
|
|
50
|
-
</
|
|
51
|
-
|
|
52
|
-
<hr>
|
|
53
|
-
|
|
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>
|
|
65
|
-
|
|
66
|
-
<hr>
|
|
62
|
+
</div>
|
|
@@ -1,73 +1,75 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<nav aria-label="breadcrumb">
|
|
2
|
+
<ul>
|
|
3
|
+
<li><a href="/<%= plural_table_name %>"><%= plural_table_name.humanize %></a></li>
|
|
4
|
+
<li>New <%= singular_table_name.humanize.downcase %></li>
|
|
5
|
+
</ul>
|
|
6
|
+
</nav>
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
<
|
|
8
|
+
<div class="card">
|
|
9
|
+
<header>
|
|
10
|
+
<h1>
|
|
11
|
+
Add a new <%= singular_table_name.humanize.downcase %>
|
|
12
|
+
</h1>
|
|
13
|
+
</header>
|
|
7
14
|
|
|
8
15
|
<% if with_sentinels? -%>
|
|
9
|
-
<!-- Form <%= singular_table_name %> start -->
|
|
16
|
+
<!-- Form <%= singular_table_name %> start -->
|
|
10
17
|
<% end -%>
|
|
11
|
-
<form action="/create_<%= singular_table_name %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
18
|
+
<form action="/create_<%= singular_table_name %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
12
19
|
<% if with_sentinels? -%>
|
|
13
|
-
<!-- Form <%= singular_table_name %> end -->
|
|
20
|
+
<!-- Form <%= singular_table_name %> end -->
|
|
14
21
|
<% end -%>
|
|
15
22
|
|
|
16
23
|
<% attributes.each do |attribute| -%>
|
|
17
24
|
<% if with_sentinels? -%>
|
|
18
|
-
|
|
25
|
+
<!-- Label and input for <%= attribute.column_name %> start -->
|
|
19
26
|
<% end -%>
|
|
20
27
|
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
<div>
|
|
29
|
+
<input type="hidden" value="0" name="<%= attribute.column_name %>_param">
|
|
23
30
|
<% if with_sentinels? -%>
|
|
24
|
-
|
|
31
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
25
32
|
<% end -%>
|
|
26
|
-
|
|
33
|
+
<input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox">
|
|
27
34
|
<% if with_sentinels? -%>
|
|
28
|
-
|
|
35
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
29
36
|
<% end -%>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
<label for="<%= attribute.column_name %>_field">
|
|
38
|
+
<%= attribute.column_name.humanize %>
|
|
39
|
+
</label>
|
|
40
|
+
</div>
|
|
34
41
|
<% else -%>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
<div>
|
|
43
|
+
<label for="<%= attribute.column_name %>_field">
|
|
44
|
+
<%= attribute.column_name.humanize %>
|
|
45
|
+
</label>
|
|
39
46
|
|
|
40
47
|
<% if [:text_area, :textarea].include?(attribute.field_type) -%>
|
|
41
48
|
<% if with_sentinels? -%>
|
|
42
|
-
|
|
49
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
43
50
|
<% end -%>
|
|
44
|
-
|
|
51
|
+
<textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"></textarea>
|
|
45
52
|
<% if with_sentinels? -%>
|
|
46
|
-
|
|
53
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
47
54
|
<% end -%>
|
|
48
55
|
<% else -%>
|
|
49
56
|
<% if with_sentinels? -%>
|
|
50
|
-
|
|
57
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
51
58
|
<% end -%>
|
|
52
|
-
|
|
59
|
+
<input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param">
|
|
53
60
|
<% if with_sentinels? -%>
|
|
54
|
-
|
|
61
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
55
62
|
<% end -%>
|
|
56
63
|
<% end -%>
|
|
57
|
-
|
|
64
|
+
</div>
|
|
58
65
|
<% if with_sentinels? -%>
|
|
59
|
-
|
|
66
|
+
<!-- Label and input for <%= attribute.column_name %> end -->
|
|
60
67
|
<% end -%>
|
|
61
68
|
<% end -%>
|
|
62
69
|
|
|
63
70
|
<% end -%>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</form>
|
|
68
|
-
|
|
69
|
-
<hr>
|
|
70
|
-
|
|
71
|
-
<a href="/<%= plural_table_name %>">
|
|
72
|
-
Go back
|
|
73
|
-
</a>
|
|
71
|
+
<button type="submit">
|
|
72
|
+
Create <%= singular_table_name.humanize.downcase %>
|
|
73
|
+
</button>
|
|
74
|
+
</form>
|
|
75
|
+
</div>
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
<nav aria-label="breadcrumb">
|
|
2
|
+
<ul>
|
|
3
|
+
<li><a href="/<%= plural_table_name %>"><%= plural_table_name.humanize %></a></li>
|
|
4
|
+
<li>New <%= singular_table_name.humanize.downcase %></li>
|
|
5
|
+
</ul>
|
|
6
|
+
</nav>
|
|
7
|
+
|
|
1
8
|
<% unless skip_validation_alerts? -%>
|
|
2
9
|
<!-- Validation failure messages -->
|
|
3
10
|
<%% if @<%= singular_table_name %>.present? %>
|
|
4
11
|
<%% if @<%= singular_table_name %>.errors.any? %>
|
|
5
12
|
<%% @<%= singular_table_name %>.errors.full_messages.each do |message| %>
|
|
6
|
-
<div>
|
|
13
|
+
<div class="text-red-600">
|
|
7
14
|
<%%= message %>
|
|
8
15
|
</div>
|
|
9
16
|
<%% end %>
|
|
@@ -11,76 +18,71 @@
|
|
|
11
18
|
<%% end %>
|
|
12
19
|
|
|
13
20
|
<% end -%>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
<div class="card">
|
|
22
|
+
<header>
|
|
23
|
+
<h1>
|
|
24
|
+
Add a new <%= singular_table_name.humanize.downcase %>
|
|
25
|
+
</h1>
|
|
26
|
+
</header>
|
|
20
27
|
|
|
21
28
|
<% if with_sentinels? -%>
|
|
22
|
-
<!-- Form <%= singular_table_name %> start -->
|
|
29
|
+
<!-- Form <%= singular_table_name %> start -->
|
|
23
30
|
<% end -%>
|
|
24
|
-
<form action="/create_<%= singular_table_name %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
31
|
+
<form action="/create_<%= singular_table_name %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
25
32
|
<% if with_sentinels? -%>
|
|
26
|
-
<!-- Form <%= singular_table_name %> end -->
|
|
33
|
+
<!-- Form <%= singular_table_name %> end -->
|
|
27
34
|
<% end -%>
|
|
28
35
|
|
|
29
36
|
<% attributes.each do |attribute| -%>
|
|
30
37
|
<% if with_sentinels? -%>
|
|
31
|
-
|
|
38
|
+
<!-- Label and input for <%= attribute.column_name %> start -->
|
|
32
39
|
<% end -%>
|
|
33
40
|
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
<div>
|
|
42
|
+
<input type="hidden" value="0" name="<%= attribute.column_name %>_param">
|
|
36
43
|
<% if with_sentinels? -%>
|
|
37
|
-
|
|
44
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
38
45
|
<% end -%>
|
|
39
|
-
|
|
46
|
+
<input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" <% unless skip_validation_alerts? -%><%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%>>
|
|
40
47
|
<% if with_sentinels? -%>
|
|
41
|
-
|
|
48
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
42
49
|
<% end -%>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
<label for="<%= attribute.column_name %>_field">
|
|
51
|
+
<%= attribute.column_name.humanize %>
|
|
52
|
+
</label>
|
|
53
|
+
</div>
|
|
47
54
|
<% else -%>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
<div>
|
|
56
|
+
<label for="<%= attribute.column_name %>_field">
|
|
57
|
+
<%= attribute.column_name.humanize %>
|
|
58
|
+
</label>
|
|
52
59
|
|
|
53
60
|
<% if [:text_area, :textarea].include?(attribute.field_type) -%>
|
|
54
61
|
<% if with_sentinels? -%>
|
|
55
|
-
|
|
62
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
56
63
|
<% end -%>
|
|
57
|
-
|
|
64
|
+
<textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><% unless skip_validation_alerts? -%><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%></textarea>
|
|
58
65
|
<% if with_sentinels? -%>
|
|
59
|
-
|
|
66
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
60
67
|
<% end -%>
|
|
61
68
|
<% else -%>
|
|
62
69
|
<% if with_sentinels? -%>
|
|
63
|
-
|
|
70
|
+
<!-- Input for <%= attribute.column_name %> start -->
|
|
64
71
|
<% end -%>
|
|
65
|
-
|
|
72
|
+
<input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" <% unless skip_validation_alerts? -%> value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>"<% end -%>>
|
|
66
73
|
<% if with_sentinels? -%>
|
|
67
|
-
|
|
74
|
+
<!-- Input for <%= attribute.column_name %> end -->
|
|
68
75
|
<% end -%>
|
|
69
76
|
<% end -%>
|
|
70
|
-
|
|
77
|
+
</div>
|
|
71
78
|
<% if with_sentinels? -%>
|
|
72
|
-
|
|
79
|
+
<!-- Label and input for <%= attribute.column_name %> end -->
|
|
73
80
|
<% end -%>
|
|
74
81
|
<% end -%>
|
|
75
82
|
|
|
76
83
|
<% end -%>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</form>
|
|
81
|
-
|
|
82
|
-
<hr>
|
|
83
|
-
|
|
84
|
-
<a href="/<%= plural_table_name %>">
|
|
85
|
-
Go back
|
|
86
|
-
</a>
|
|
84
|
+
<button type="submit">
|
|
85
|
+
Create <%= singular_table_name.humanize.downcase %>
|
|
86
|
+
</button>
|
|
87
|
+
</form>
|
|
88
|
+
</div>
|
|
@@ -1,40 +1,30 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<nav aria-label="breadcrumb">
|
|
2
|
+
<ul>
|
|
3
|
+
<li><a href="/<%= plural_table_name %>"><%= plural_table_name.humanize %></a></li>
|
|
4
|
+
<li><%= singular_table_name.humanize %> #<%%= @the_<%= singular_table_name %>.id %></li>
|
|
5
|
+
</ul>
|
|
6
|
+
</nav>
|
|
4
7
|
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
</
|
|
10
|
-
</
|
|
8
|
+
<div class="card">
|
|
9
|
+
<header>
|
|
10
|
+
<h1>
|
|
11
|
+
<%= singular_table_name.humanize %> #<%%= @the_<%= singular_table_name %>.id %> details
|
|
12
|
+
</h1>
|
|
13
|
+
</header>
|
|
11
14
|
|
|
12
|
-
<% unless read_only? -%>
|
|
13
|
-
<% if with_sentinels? -%>
|
|
14
|
-
<!-- Delete link <%= singular_table_name %> start -->
|
|
15
|
-
<% end -%>
|
|
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>
|
|
21
|
-
<% if with_sentinels? -%>
|
|
22
|
-
<!-- Delete link <%= singular_table_name %> end -->
|
|
23
|
-
<% end -%>
|
|
24
|
-
<% end -%>
|
|
25
15
|
<dl>
|
|
26
16
|
<% attributes.each do |attribute| -%>
|
|
27
17
|
<dt>
|
|
28
18
|
<%= attribute.human_name %>
|
|
29
19
|
</dt>
|
|
30
20
|
<% if with_sentinels? -%>
|
|
31
|
-
|
|
21
|
+
<!-- Display the_<%= attribute.column_name %> start -->
|
|
32
22
|
<% end -%>
|
|
33
23
|
<dd>
|
|
34
24
|
<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>
|
|
35
25
|
</dd>
|
|
36
26
|
<% if with_sentinels? -%>
|
|
37
|
-
|
|
27
|
+
<!-- Display the_<%= attribute.column_name %> end -->
|
|
38
28
|
<% end -%>
|
|
39
29
|
|
|
40
30
|
<% end -%>
|
|
@@ -42,53 +32,66 @@
|
|
|
42
32
|
Created at
|
|
43
33
|
</dt>
|
|
44
34
|
<% if with_sentinels? -%>
|
|
45
|
-
|
|
35
|
+
<!-- Display created_at start -->
|
|
46
36
|
<% end -%>
|
|
47
37
|
<dd>
|
|
48
38
|
<%%= time_ago_in_words(@the_<%= singular_table_name %>.created_at) %> ago
|
|
49
39
|
</dd>
|
|
50
40
|
<% if with_sentinels? -%>
|
|
51
|
-
|
|
41
|
+
<!-- Display created_at end -->
|
|
52
42
|
<% end -%>
|
|
53
43
|
|
|
54
44
|
<dt>
|
|
55
45
|
Updated at
|
|
56
46
|
</dt>
|
|
57
47
|
<% if with_sentinels? -%>
|
|
58
|
-
|
|
48
|
+
<!-- Display updated_at start -->
|
|
59
49
|
<% end -%>
|
|
60
50
|
<dd>
|
|
61
51
|
<%%= time_ago_in_words(@the_<%= singular_table_name %>.updated_at) %> ago
|
|
62
52
|
</dd>
|
|
63
53
|
<% if with_sentinels? -%>
|
|
64
|
-
|
|
54
|
+
<!-- Display updated_at end -->
|
|
65
55
|
<% end -%>
|
|
66
56
|
</dl>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<hr>
|
|
57
|
+
<% unless read_only? -%>
|
|
70
58
|
|
|
71
59
|
<% if with_sentinels? -%>
|
|
60
|
+
<!-- Delete link <%= singular_table_name %> start -->
|
|
61
|
+
<% end -%>
|
|
62
|
+
<p>
|
|
63
|
+
<a href="/delete_<%= singular_table_name %>/<%%= @the_<%= singular_table_name %>.id %>" class="btn btn-outline">
|
|
64
|
+
Delete <%= singular_table_name.humanize.downcase %>
|
|
65
|
+
</a>
|
|
66
|
+
</p>
|
|
67
|
+
<% if with_sentinels? -%>
|
|
68
|
+
<!-- Delete link <%= singular_table_name %> end -->
|
|
69
|
+
<% end -%>
|
|
70
|
+
<% end -%>
|
|
71
|
+
</div>
|
|
72
|
+
<% if with_sentinels? -%>
|
|
73
|
+
|
|
72
74
|
<!-- Show Page Customization starts -->
|
|
73
75
|
|
|
74
76
|
<!-- Show Page Customization end -->
|
|
75
77
|
<% end -%>
|
|
78
|
+
<% unless read_only? -%>
|
|
76
79
|
|
|
77
|
-
<
|
|
80
|
+
<div class="card">
|
|
78
81
|
<header>
|
|
79
82
|
<h2>
|
|
80
83
|
Edit <%= singular_table_name.humanize.downcase %>
|
|
81
84
|
</h2>
|
|
82
85
|
</header>
|
|
83
86
|
|
|
84
|
-
<form action="/modify_<%= singular_table_name %>/<%%= @the_<%= singular_table_name %>.id %>"
|
|
87
|
+
<form action="/modify_<%= singular_table_name %>/<%%= @the_<%= singular_table_name %>.id %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
85
88
|
<% attributes.each do |attribute| -%>
|
|
86
89
|
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
87
90
|
<div>
|
|
88
91
|
<input type="checkbox" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="1" <%%= "checked" if @the_<%= singular_table_name %>.<%= attribute.column_name %> %>>
|
|
89
92
|
|
|
90
93
|
<label for="<%= attribute.column_name %>_field">
|
|
91
|
-
|
|
94
|
+
<%= attribute.column_name.humanize %>
|
|
92
95
|
</label>
|
|
93
96
|
</div>
|
|
94
97
|
|
|
@@ -101,8 +104,7 @@
|
|
|
101
104
|
<% if [:text_area, :textarea].include?(attribute.field_type) -%>
|
|
102
105
|
<textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param"><%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
|
|
103
106
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :datetime -%>
|
|
104
|
-
<input type="datetime-local" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param"
|
|
105
|
-
value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
|
|
107
|
+
<input type="datetime-local" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
|
|
106
108
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :date -%>
|
|
107
109
|
<input type="date" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
|
|
108
110
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :time -%>
|
|
@@ -120,6 +122,5 @@
|
|
|
120
122
|
Update <%= singular_table_name.humanize.downcase %>
|
|
121
123
|
</button>
|
|
122
124
|
</form>
|
|
123
|
-
</
|
|
124
|
-
|
|
125
|
-
<hr>
|
|
125
|
+
</div>
|
|
126
|
+
<% end -%>
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
<
|
|
1
|
+
<nav aria-label="breadcrumb">
|
|
2
|
+
<ul>
|
|
3
|
+
<li><a href="/<%= plural_table_name.underscore %>"><%= plural_table_name.humanize %></a></li>
|
|
4
|
+
<li><%= singular_table_name.humanize %> #<%%= @<%= singular_table_name %>.id %></li>
|
|
5
|
+
</ul>
|
|
6
|
+
</nav>
|
|
2
7
|
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
<div class="card">
|
|
9
|
+
<header>
|
|
10
|
+
<h1>
|
|
11
|
+
You updated <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>!
|
|
12
|
+
</h1>
|
|
13
|
+
</header>
|
|
7
14
|
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
<p>
|
|
16
|
+
<a href="/<%= plural_table_name.underscore %>/<%%= @<%= singular_table_name.underscore %>.id %>">
|
|
17
|
+
Click here
|
|
18
|
+
</a>
|
|
19
|
+
|
|
20
|
+
to check it out.
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|