質問編集履歴

1

問題箇所のコードの省略を解消

2020/05/05 09:12

投稿

t.togashi
t.togashi

スコア22

test CHANGED
File without changes
test CHANGED
@@ -22,29 +22,157 @@
22
22
 
23
23
  新規登録フォーム
24
24
 
25
+ <div id="new-form">
26
+
25
- <%= form_with model: Overtime.new do |form| %>
27
+ <%= form_with model: Overtime.new do |form| %>
28
+
29
+
30
+
26
-
31
+ <div class="input-group">
32
+
33
+ <div class="input-group-prepend">
34
+
35
+ <span class="input-group-text">日付</span>
36
+
27
-  (略)
37
+ </div>
38
+
28
-
39
+ <%= form.date_field :date, class: 'form-control', id: "new-calendar" %>
40
+
41
+ </div>
42
+
43
+
44
+
45
+ <div class="input-group mt-3 input-time">
46
+
47
+ <div class="input-group-prepend">
48
+
49
+ <span class="input-group-text">開始時刻</span>
50
+
51
+ </div>
52
+
29
- <%= form.time_select :work_start_time, {}, required: true %>
53
+ <%= form.time_select :work_start_time, {}, required: true %>
30
-
54
+
31
-  (略)
55
+ </div>
56
+
57
+
58
+
32
-
59
+ <div class="input-group mt-3 input-time">
60
+
61
+ <div class="input-group-prepend">
62
+
63
+ <span class="input-group-text">終了時刻</span>
64
+
65
+ </div>
66
+
67
+ <%= form.time_select :work_end_time, {}, required: true %>
68
+
69
+ </div>
70
+
71
+
72
+
73
+ <div class="input-group mt-3">
74
+
75
+ <div class="input-group-prepend">
76
+
77
+ <span class="input-group-text">残業時間</span>
78
+
79
+ </div>
80
+
81
+ <%= form.text_field :work_time, class: 'form-control', id: "new-work-time", readonly: true, required: true %>
82
+
83
+ </div>
84
+
85
+
86
+
87
+ <div class="form-group mt-3">
88
+
89
+ <%= form.submit '追加', class: 'btn btn-primary btn-block' %>
90
+
91
+ </div>
92
+
33
- <% end %>
93
+ <% end %>
94
+
95
+ </div>
96
+
97
+
34
98
 
35
99
 
36
100
 
37
101
  修正フォーム
38
102
 
103
+ <div id="edit-form">
104
+
39
- <%= form_with model: Overtime.new, method: :patch do |form| %>
105
+ <%= form_with model: Overtime.new, method: :patch do |form| %>
106
+
107
+
108
+
40
-
109
+ <div class="input-group">
110
+
111
+ <div class="input-group-prepend">
112
+
113
+ <span class="input-group-text">日付</span>
114
+
41
-  (略)
115
+ </div>
116
+
42
-
117
+ <%= form.date_field :date, class: 'form-control', id: "edit-calendar" %>
118
+
119
+ </div>
120
+
121
+ <small>記録が存在しない日付は選択できません</small>
122
+
123
+
124
+
125
+ <div class="input-group mt-3 input-time">
126
+
127
+ <div class="input-group-prepend">
128
+
129
+ <span class="input-group-text">開始時刻</span>
130
+
131
+ </div>
132
+
43
- <%= form.time_select :work_start_time, {}, required: true %>
133
+ <%= form.time_select :work_start_time, {}, required: true %>
44
-
134
+
45
-  (略)
135
+ </div>
136
+
137
+
138
+
46
-
139
+ <div class="input-group mt-3 input-time">
140
+
141
+ <div class="input-group-prepend">
142
+
143
+ <span class="input-group-text">終了時刻</span>
144
+
145
+ </div>
146
+
147
+ <%= form.time_select :work_end_time, {}, required: true %>
148
+
149
+ </div>
150
+
151
+
152
+
153
+ <div class="input-group mt-3">
154
+
155
+ <div class="input-group-prepend">
156
+
157
+ <span class="input-group-text">残業時間</span>
158
+
159
+ </div>
160
+
161
+ <%= form.text_field :work_time, class: 'form-control', id: "edit-work-time", readonly: true, required: true %>
162
+
163
+ </div>
164
+
165
+
166
+
167
+ <div class="form-group mt-3">
168
+
169
+ <%= form.submit '修正', class: 'btn btn-primary btn-block' %>
170
+
171
+ </div>
172
+
47
- <% end %>
173
+ <% end %>
174
+
175
+ </div>
48
176
 
49
177
  ```
50
178