回答編集履歴
1
コードの間違いを修正
answer
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
<% end %>
|
9
9
|
```
|
10
10
|
|
11
|
-
|
11
|
+
sign_out 時にリダイレクト処理が行われるので、Controller では `flash` を使用してください。
|
12
12
|
|
13
13
|
```Ruby
|
14
14
|
# controllers/application_controller.rb
|
@@ -19,7 +19,7 @@
|
|
19
19
|
if current_employee.retire_date.blank?
|
20
20
|
else
|
21
21
|
sign_out Employee.find(current_employee.id)
|
22
|
-
flash
|
22
|
+
flash[:alert] = '退職者はログインできません'
|
23
23
|
end
|
24
24
|
root_path
|
25
25
|
end
|