質問編集履歴
3
ビュー画面の記述の追加。
test
CHANGED
File without changes
|
test
CHANGED
@@ -153,3 +153,59 @@
|
|
153
153
|
|
154
154
|
|
155
155
|
```
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
```
|
160
|
+
|
161
|
+
= form_for [current_user, @event] do |f|
|
162
|
+
|
163
|
+
- if @event.errors.any?
|
164
|
+
|
165
|
+
#error_explanation
|
166
|
+
|
167
|
+
%h2= "#{pluralize(@event.errors.count, "error")} prohibited this event from being saved:"
|
168
|
+
|
169
|
+
%ul
|
170
|
+
|
171
|
+
- @event.errors.full_messages.each do |message|
|
172
|
+
|
173
|
+
%li= message
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
.field
|
178
|
+
|
179
|
+
= f.label :お名前
|
180
|
+
|
181
|
+
= f.text_field :worker_name, :placeholder => "名前を入力"
|
182
|
+
|
183
|
+
.field
|
184
|
+
|
185
|
+
= f.label :詳細な体調を記入
|
186
|
+
|
187
|
+
= f.text_area :description, :placeholder => "例)熱は○○.○℃で気分に問題はありません等ご自身の体調をご記載ください"
|
188
|
+
|
189
|
+
.field
|
190
|
+
|
191
|
+
= f.label :出勤時間
|
192
|
+
|
193
|
+
= f.time_select :start_date
|
194
|
+
|
195
|
+
.field
|
196
|
+
|
197
|
+
= f.label :退勤予定時間
|
198
|
+
|
199
|
+
= f.time_select :end_date
|
200
|
+
|
201
|
+
.actions
|
202
|
+
|
203
|
+
= f.submit '送信する'
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
```
|
208
|
+
|
209
|
+
送信するをクリックするとshowの画面にリダイレクトさせたいです。
|
210
|
+
|
211
|
+
よろしくお願いいたいます。
|
2
showのビューの記載
test
CHANGED
File without changes
|
test
CHANGED
@@ -109,3 +109,47 @@
|
|
109
109
|
```
|
110
110
|
|
111
111
|
よろしくお願いいたします。
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
```
|
118
|
+
|
119
|
+
app/views/events/show.html.haml
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
%p#notice= notice
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
%p
|
130
|
+
|
131
|
+
%b Worker name:
|
132
|
+
|
133
|
+
= @event.worker_name
|
134
|
+
|
135
|
+
%p
|
136
|
+
|
137
|
+
%b Description:
|
138
|
+
|
139
|
+
= @event.description
|
140
|
+
|
141
|
+
%p
|
142
|
+
|
143
|
+
%b Start date:
|
144
|
+
|
145
|
+
= @event.start_date
|
146
|
+
|
147
|
+
%p
|
148
|
+
|
149
|
+
%b End date:
|
150
|
+
|
151
|
+
= @event.end_date
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
```
|
1
わかりやすくした
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,11 +18,15 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
-
resources :users, only: :show do
|
21
|
+
resources :users, only: :show do
|
22
22
|
|
23
23
|
resources :events
|
24
24
|
|
25
25
|
end
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
(ネストしています)
|
26
30
|
|
27
31
|
```
|
28
32
|
|