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
|
@@ -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
|
-
<% if attribute.field_type
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
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
|
-
<% if attribute.field_type
|
|
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 %>
|
|
@@ -13,31 +25,31 @@
|
|
|
13
25
|
|
|
14
26
|
<form action="/insert_<%= singular_table_name %>"<% unless skip_post? -%> method="post"<% end -%>>
|
|
15
27
|
<% attributes.each do |attribute| -%>
|
|
16
|
-
<% if attribute.field_type
|
|
28
|
+
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
17
29
|
<div>
|
|
18
|
-
<input type="checkbox" id="<%= attribute.column_name %>
|
|
30
|
+
<input type="checkbox" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="1">
|
|
19
31
|
|
|
20
|
-
<label for="<%= attribute.column_name %>
|
|
32
|
+
<label for="<%= attribute.column_name %>_field"><%= attribute.column_name.humanize %></label>
|
|
21
33
|
</div>
|
|
22
34
|
|
|
23
35
|
<% else -%>
|
|
24
36
|
<div>
|
|
25
|
-
<label for="<%= attribute.column_name %>
|
|
37
|
+
<label for="<%= attribute.column_name %>_field">
|
|
26
38
|
<%= attribute.column_name.humanize %>
|
|
27
39
|
</label>
|
|
28
40
|
|
|
29
|
-
<% if attribute.field_type
|
|
30
|
-
<textarea id="<%= attribute.column_name %>
|
|
41
|
+
<% if [:text_area, :textarea].include?(attribute.field_type) -%>
|
|
42
|
+
<textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"></textarea>
|
|
31
43
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :datetime -%>
|
|
32
|
-
<input type="datetime-local" id="<%= attribute.column_name %>
|
|
44
|
+
<input type="datetime-local" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param">
|
|
33
45
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :date -%>
|
|
34
|
-
<input type="date" id="<%= attribute.column_name %>
|
|
46
|
+
<input type="date" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param">
|
|
35
47
|
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :time -%>
|
|
36
|
-
<input type="time" id="<%= attribute.column_name %>
|
|
37
|
-
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :
|
|
38
|
-
<input type="number" id="<%= attribute.column_name %>
|
|
48
|
+
<input type="time" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param">
|
|
49
|
+
<% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :number -%>
|
|
50
|
+
<input type="number" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param">
|
|
39
51
|
<% else -%>
|
|
40
|
-
<input type="text" id="<%= attribute.column_name %>
|
|
52
|
+
<input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param">
|
|
41
53
|
<% end -%>
|
|
42
54
|
</div>
|
|
43
55
|
|
|
@@ -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
|
-
<% if attribute.field_type
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
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
|
-
<% if attribute.field_type
|
|
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
|
-
<% if attribute.field_type
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
<% if [:check_box, :checkbox].include?(attribute.field_type) -%>
|
|
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
|
-
<% if attribute.field_type
|
|
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>
|