draft_generators 0.0.5 → 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/account/templates/controllers/authentication_controller.rb +12 -12
- data/lib/generators/draft/account/templates/views/authentication/edit_profile.html.erb +10 -10
- data/lib/generators/draft/account/templates/views/authentication/edit_profile_with_errors.html.erb +10 -10
- data/lib/generators/draft/account/templates/views/authentication/sign_in.html.erb +4 -4
- data/lib/generators/draft/account/templates/views/authentication/sign_up.html.erb +12 -12
- data/lib/generators/draft/resource/templates/controllers/controller.rb +6 -6
- data/lib/generators/draft/resource/templates/specs/crud_spec.rb +2 -2
- data/lib/generators/draft/resource/templates/views/association_new_form.html.erb +9 -9
- 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 +44 -41
- data/lib/generators/draft/resource/templates/views/edit_form_with_errors.html.erb +46 -43
- data/lib/generators/draft/resource/templates/views/index.html.erb +30 -34
- data/lib/generators/draft/resource/templates/views/new_form.html.erb +44 -42
- data/lib/generators/draft/resource/templates/views/new_form_with_errors.html.erb +46 -44
- data/lib/generators/draft/resource/templates/views/show.html.erb +51 -50
- data/lib/generators/draft/resource/templates/views/update_row.html.erb +20 -7
- data/lib/generators/draft/scaffold/templates/_form.html.erb +2 -2
- metadata +2 -2
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]
|
|
@@ -7,9 +7,9 @@ class <%= class_name.singularize %>AuthenticationController < ApplicationControl
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def create_cookie
|
|
10
|
-
<%= singular_table_name.underscore %> = <%= class_name.singularize %>.where({ :email => params.fetch("
|
|
10
|
+
<%= singular_table_name.underscore %> = <%= class_name.singularize %>.where({ :email => params.fetch("email_param") }).first
|
|
11
11
|
|
|
12
|
-
the_supplied_password = params.fetch("
|
|
12
|
+
the_supplied_password = params.fetch("password_param")
|
|
13
13
|
|
|
14
14
|
if <%= singular_table_name.underscore %> != nil
|
|
15
15
|
are_they_legit = <%= singular_table_name.underscore %>.authenticate(the_supplied_password)
|
|
@@ -39,13 +39,13 @@ class <%= class_name.singularize %>AuthenticationController < ApplicationControl
|
|
|
39
39
|
def create
|
|
40
40
|
@<%= singular_table_name.underscore %> = <%= class_name.singularize %>.new
|
|
41
41
|
<% attributes.each do |attribute| -%>
|
|
42
|
-
<% if attribute.field_type
|
|
43
|
-
@<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("
|
|
42
|
+
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
43
|
+
@<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("<%= attribute.column_name %>_param", false)
|
|
44
44
|
<% elsif attribute.column_name != "password_digest" -%>
|
|
45
|
-
@<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("
|
|
45
|
+
@<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("<%= attribute.column_name %>_param")
|
|
46
46
|
<% else -%>
|
|
47
|
-
@<%= singular_table_name.underscore %>.password = params.fetch("
|
|
48
|
-
@<%= singular_table_name.underscore %>.password_confirmation = params.fetch("
|
|
47
|
+
@<%= singular_table_name.underscore %>.password = params.fetch("password_param")
|
|
48
|
+
@<%= singular_table_name.underscore %>.password_confirmation = params.fetch("password_confirmation_param")
|
|
49
49
|
<% end -%>
|
|
50
50
|
<% end -%>
|
|
51
51
|
|
|
@@ -67,13 +67,13 @@ class <%= class_name.singularize %>AuthenticationController < ApplicationControl
|
|
|
67
67
|
def update
|
|
68
68
|
@<%= singular_table_name.underscore %> = @current_<%= singular_table_name.underscore %>
|
|
69
69
|
<% attributes.each do |attribute| -%>
|
|
70
|
-
<% if attribute.field_type
|
|
71
|
-
@<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("
|
|
70
|
+
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
71
|
+
@<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("<%= attribute.column_name %>_param", false)
|
|
72
72
|
<% elsif attribute.column_name != "password_digest" -%>
|
|
73
|
-
@<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("
|
|
73
|
+
@<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("<%= attribute.column_name %>_param")
|
|
74
74
|
<% else -%>
|
|
75
|
-
@<%= singular_table_name.underscore %>.password = params.fetch("
|
|
76
|
-
@<%= singular_table_name.underscore %>.password_confirmation = params.fetch("
|
|
75
|
+
@<%= singular_table_name.underscore %>.password = params.fetch("password_param")
|
|
76
|
+
@<%= singular_table_name.underscore %>.password_confirmation = params.fetch("password_confirmation_param")
|
|
77
77
|
<% end -%>
|
|
78
78
|
<% end -%>
|
|
79
79
|
|
|
@@ -8,26 +8,26 @@
|
|
|
8
8
|
<% attributes.each do |attribute| -%>
|
|
9
9
|
<% if attribute.column_name != "password_digest" -%>
|
|
10
10
|
<div>
|
|
11
|
-
<label for="<%= attribute.column_name %>
|
|
12
|
-
<% if attribute.field_type
|
|
13
|
-
<textarea id="<%= attribute.column_name %>
|
|
14
|
-
<% elsif attribute.field_type
|
|
15
|
-
<input id="<%= attribute.column_name %>
|
|
11
|
+
<label for="<%= attribute.column_name %>_field"><%= attribute.column_name.humanize %></label>
|
|
12
|
+
<% if [:text_area, :textarea].include?(attribute.field_type) -%>
|
|
13
|
+
<textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><%%= @current_<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
|
|
14
|
+
<% elsif [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
15
|
+
<input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" value="1" <%%= "checked" if @current_<%= singular_table_name %>.<%= attribute.column_name %> %>>
|
|
16
16
|
<% else -%>
|
|
17
|
-
<input id="<%= attribute.column_name %>
|
|
17
|
+
<input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @current_<%= singular_table_name.underscore %>.<%= attribute.column_name %> %>">
|
|
18
18
|
<% end -%>
|
|
19
19
|
</div>
|
|
20
20
|
<% end -%>
|
|
21
21
|
<% end -%>
|
|
22
22
|
|
|
23
23
|
<div>
|
|
24
|
-
<label for="
|
|
25
|
-
<input id="
|
|
24
|
+
<label for="password_field">Password</label>
|
|
25
|
+
<input id="password_field" name="password_param" placeholder="Choose a password..." type="password">
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
28
|
<div>
|
|
29
|
-
<label for="
|
|
30
|
-
<input id="
|
|
29
|
+
<label for="password_confirmation_field">Password Confirmation</label>
|
|
30
|
+
<input id="password_confirmation_field" name="password_confirmation_param" placeholder="Confirm your password..." type="password">
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
33
|
<button>
|
data/lib/generators/draft/account/templates/views/authentication/edit_profile_with_errors.html.erb
CHANGED
|
@@ -15,25 +15,25 @@
|
|
|
15
15
|
<% attributes.each do |attribute| -%>
|
|
16
16
|
<% if attribute.column_name != "password_digest" %>
|
|
17
17
|
<div>
|
|
18
|
-
<label for="<%= attribute.column_name %>
|
|
19
|
-
<% if attribute.field_type
|
|
20
|
-
<textarea id="<%= attribute.column_name %>
|
|
21
|
-
<% elsif attribute.field_type
|
|
22
|
-
<input id="<%= attribute.column_name %>
|
|
18
|
+
<label for="<%= attribute.column_name %>_field"><%= attribute.column_name.humanize %></label>
|
|
19
|
+
<% if [:text_area, :textarea].include?(attribute.field_type) %>
|
|
20
|
+
<textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><%%= @current_<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
|
|
21
|
+
<% elsif [:check_box, :checkbox].include?(attribute.field_type) %>
|
|
22
|
+
<input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" value="1" <%%= "checked" if @current_<%= singular_table_name %>.<%= attribute.column_name %> %>>
|
|
23
23
|
<% else %>
|
|
24
|
-
<input id="<%= attribute.column_name %>
|
|
24
|
+
<input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @current_<%= singular_table_name.underscore %>.<%= attribute.column_name %> %>">
|
|
25
25
|
<% end %>
|
|
26
26
|
</div>
|
|
27
27
|
<% end -%>
|
|
28
28
|
<% end %>
|
|
29
29
|
<div>
|
|
30
|
-
<label for="
|
|
31
|
-
<input id="
|
|
30
|
+
<label for="password_field">Password</label>
|
|
31
|
+
<input id="password_field" name="password_param" placeholder="Choose a new password..." type="password">
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
<div>
|
|
35
|
-
<label for="
|
|
36
|
-
<input id="
|
|
35
|
+
<label for="password_confirmation_field">Password Confirmation</label>
|
|
36
|
+
<input id="password_confirmation_field" name="password_confirmation_param" placeholder="Confirm your new password..." type="password">
|
|
37
37
|
</div>
|
|
38
38
|
|
|
39
39
|
<button>
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
<form action="/<%= singular_table_name.underscore %>_verify_credentials" method="post">
|
|
4
4
|
<div>
|
|
5
|
-
<label for="
|
|
6
|
-
<input id="
|
|
5
|
+
<label for="email_field">Email</label>
|
|
6
|
+
<input id="email_field" name="email_param" placeholder="Enter your email..." type="text">
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
9
|
<div>
|
|
10
|
-
<label for="
|
|
11
|
-
<input id="
|
|
10
|
+
<label for="password_field">Password</label>
|
|
11
|
+
<input id="password_field" name="password_param" placeholder="Enter your password..." type="password">
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
14
|
<button>
|
|
@@ -3,32 +3,32 @@
|
|
|
3
3
|
<form action="/insert_<%= singular_table_name.underscore %>" method="post">
|
|
4
4
|
|
|
5
5
|
<div>
|
|
6
|
-
<label for="
|
|
7
|
-
<input id="
|
|
6
|
+
<label for="email_field">Email</label>
|
|
7
|
+
<input id="email_field" name="email_param" placeholder="Choose a email..." type="text">
|
|
8
8
|
</div>
|
|
9
9
|
<% attributes.each do |attribute| -%>
|
|
10
10
|
<% if attribute.column_name != "password_digest" && attribute.column_name != "email" -%>
|
|
11
11
|
<div>
|
|
12
|
-
<label for="<%= attribute.column_name %>
|
|
13
|
-
<%- if attribute.field_type
|
|
14
|
-
<input id="<%= attribute.column_name %>
|
|
15
|
-
<%- elsif attribute.field_type
|
|
16
|
-
<textarea id="<%= attribute.column_name %>
|
|
12
|
+
<label for="<%= attribute.column_name %>_field"><%= attribute.column_name.humanize %></label>
|
|
13
|
+
<%- if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
14
|
+
<input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox">
|
|
15
|
+
<%- elsif [:text_area, :textarea].include?(attribute.field_type) -%>
|
|
16
|
+
<textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"></textarea>
|
|
17
17
|
<%- else -%>
|
|
18
|
-
<input type="text" id="<%= attribute.column_name %>
|
|
18
|
+
<input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param">
|
|
19
19
|
<%- end -%>
|
|
20
20
|
</div>
|
|
21
21
|
<%- end -%>
|
|
22
22
|
<% end -%>
|
|
23
23
|
|
|
24
24
|
<div>
|
|
25
|
-
<label for="
|
|
26
|
-
<input id="
|
|
25
|
+
<label for="password_field">Password</label>
|
|
26
|
+
<input id="password_field" name="password_param" placeholder="Choose a password..." type="password">
|
|
27
27
|
</div>
|
|
28
28
|
|
|
29
29
|
<div>
|
|
30
|
-
<label for="
|
|
31
|
-
<input id="
|
|
30
|
+
<label for="password_confirmation_field">Password Confirmation</label>
|
|
31
|
+
<input id="password_confirmation_field" name="password_confirmation_param" placeholder="Confirm your password..." type="password">
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
<button>
|
|
@@ -20,10 +20,10 @@ class <%= plural_table_name.camelize %>Controller < ApplicationController
|
|
|
20
20
|
def create
|
|
21
21
|
the_<%= singular_table_name.underscore %> = <%= class_name.singularize %>.new
|
|
22
22
|
<% attributes.each do |attribute| -%>
|
|
23
|
-
<% if attribute.field_type
|
|
24
|
-
the_<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("
|
|
23
|
+
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
24
|
+
the_<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("<%= attribute.column_name %>_param", false)
|
|
25
25
|
<% else -%>
|
|
26
|
-
the_<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("
|
|
26
|
+
the_<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("<%= attribute.column_name %>_param")
|
|
27
27
|
<% end -%>
|
|
28
28
|
<% end -%>
|
|
29
29
|
|
|
@@ -52,10 +52,10 @@ class <%= plural_table_name.camelize %>Controller < ApplicationController
|
|
|
52
52
|
the_<%= singular_table_name.underscore %> = <%= class_name.singularize %>.where({ :id => the_id }).at(0)
|
|
53
53
|
|
|
54
54
|
<% attributes.each do |attribute| -%>
|
|
55
|
-
<% if attribute.field_type
|
|
56
|
-
the_<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("
|
|
55
|
+
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
56
|
+
the_<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("<%= attribute.column_name %>_param", false)
|
|
57
57
|
<% else -%>
|
|
58
|
-
the_<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("
|
|
58
|
+
the_<%= singular_table_name.underscore %>.<%= attribute.column_name %> = params.fetch("<%= attribute.column_name %>_param")
|
|
59
59
|
<% end -%>
|
|
60
60
|
<% end -%>
|
|
61
61
|
|
|
@@ -199,8 +199,8 @@ feature "<%= plural_table_name.humanize.upcase %>" do
|
|
|
199
199
|
click_on "Edit <%= singular_table_name.humanize.downcase %>"
|
|
200
200
|
|
|
201
201
|
<% case attribute.field_type -%>
|
|
202
|
-
<% when :check_box -%>
|
|
203
|
-
<% when :text_area -%>
|
|
202
|
+
<% when :check_box, :checkbox -%>
|
|
203
|
+
<% when :text_area, :textarea -%>
|
|
204
204
|
expect(page).to have_content(<%= singular_table_name %>_to_edit.<%= attribute.column_name %>)
|
|
205
205
|
<% else -%>
|
|
206
206
|
expect(page).to have_css("input[value='#{<%= singular_table_name %>_to_edit.<%= attribute.column_name %>}']")
|
|
@@ -14,34 +14,34 @@
|
|
|
14
14
|
<% if with_sentinels? -%>
|
|
15
15
|
<!-- Input for <%= attribute.column_name %> start -->
|
|
16
16
|
<% end -%>
|
|
17
|
-
<input type="hidden" name="<%= attribute.column_name %>" value="<%%= <%= new_form_hidden_variable %> %>">
|
|
17
|
+
<input type="hidden" name="<%= attribute.column_name %>_param" value="<%%= <%= new_form_hidden_variable %> %>">
|
|
18
18
|
<% if with_sentinels? -%>
|
|
19
19
|
<!-- Input for <%= attribute.column_name %> end -->
|
|
20
20
|
<% end -%>
|
|
21
|
-
<% elsif attribute.field_type
|
|
21
|
+
<% elsif [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
22
22
|
<div>
|
|
23
|
-
<label for="<%= attribute.column_name %>">
|
|
23
|
+
<label for="<%= attribute.column_name %>_field">
|
|
24
24
|
<%= attribute.column_name.humanize %>
|
|
25
25
|
</label>
|
|
26
26
|
<% if with_sentinels? -%>
|
|
27
27
|
<!-- Input for <%= attribute.column_name %> start -->
|
|
28
28
|
<% end -%>
|
|
29
|
-
<input id="<%= attribute.column_name %>" name="<%= attribute.column_name %>" type="checkbox" <% unless skip_validation_alerts? -%><%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%>>
|
|
29
|
+
<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 -%>>
|
|
30
30
|
<% if with_sentinels? -%>
|
|
31
31
|
<!-- Input for <%= attribute.column_name %> end -->
|
|
32
32
|
<% end -%>
|
|
33
33
|
</div>
|
|
34
34
|
<% else -%>
|
|
35
35
|
<div>
|
|
36
|
-
<label for="<%= attribute.column_name %>">
|
|
36
|
+
<label for="<%= attribute.column_name %>_field">
|
|
37
37
|
<%= attribute.column_name.humanize %>
|
|
38
38
|
</label>
|
|
39
39
|
|
|
40
|
-
<% if attribute.field_type
|
|
40
|
+
<% if [:text_area, :textarea].include?(attribute.field_type) -%>
|
|
41
41
|
<% if with_sentinels? -%>
|
|
42
42
|
<!-- Input for <%= attribute.column_name %> start -->
|
|
43
43
|
<% end -%>
|
|
44
|
-
<textarea id="<%= attribute.column_name %>" name="<%= attribute.column_name %>" rows="3"><% unless skip_validation_alerts? -%><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%></textarea>
|
|
44
|
+
<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>
|
|
45
45
|
<% if with_sentinels? -%>
|
|
46
46
|
<!-- Input for <%= attribute.column_name %> end -->
|
|
47
47
|
<% end -%>
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
<% if with_sentinels? -%>
|
|
50
50
|
<!-- Input for <%= attribute.column_name %> start -->
|
|
51
51
|
<% end -%>
|
|
52
|
-
<input type="text" id="<%= attribute.column_name %>" name="<%= attribute.column_name %>" <% unless skip_validation_alerts? -%> value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>"<% end -%>>
|
|
52
|
+
<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 -%>>
|
|
53
53
|
<% if with_sentinels? -%>
|
|
54
54
|
<!-- Input for <%= attribute.column_name %> end -->
|
|
55
55
|
<% end -%>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<% end -%>
|
|
62
62
|
|
|
63
63
|
<% end -%>
|
|
64
|
-
<button>
|
|
64
|
+
<button type="submit">
|
|
65
65
|
Create <%= singular_table_name.humanize.downcase %>
|
|
66
66
|
</button>
|
|
67
67
|
</form>
|
|
@@ -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
|
-
<% if attribute.field_type
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
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
|
-
<% if attribute.field_type
|
|
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>
|