質問編集履歴
1
エラーのスクショの追加、ファイル名の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
|
7
7
|
### 発生している問題・エラーメッセージ
|
8
8
|
|
9
|
-
```エラー
|
10
|
-
|
9
|
+

|
11
|
-
Showing /home/ec2-user/environment/bookers/app/views/books/index.html.erb where line #23 raised:
|
12
10
|
|
13
|
-
undefined method `each' for nil:NilClass
|
14
|
-
```
|
15
11
|
|
16
12
|
### 該当のソースコード
|
13
|
+
|
14
|
+
|
15
|
+
|
17
|
-
```routes
|
16
|
+
```routes
|
17
|
+
|
18
18
|
Rails.application.routes.draw do
|
19
19
|
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
20
20
|
get '' => 'homes#top'
|
@@ -30,14 +30,14 @@
|
|
30
30
|
end
|
31
31
|
```
|
32
32
|
|
33
|
-
```
|
33
|
+
```modelBook
|
34
34
|
class Book < ApplicationRecord
|
35
35
|
validates :title, presence: true
|
36
36
|
validates :body, presence: true
|
37
37
|
end
|
38
38
|
```
|
39
39
|
|
40
|
-
```
|
40
|
+
```booksController
|
41
41
|
class BooksController < ApplicationController
|
42
42
|
|
43
43
|
def new
|
@@ -111,10 +111,11 @@
|
|
111
111
|
end
|
112
112
|
|
113
113
|
```
|
114
|
-
```index.html.erb
|
115
114
|
|
115
|
+
```index
|
116
116
|
|
117
117
|
|
118
|
+
|
118
119
|
<div class="notifications">
|
119
120
|
<% flash.each do |message_type, message| %>
|
120
121
|
<%= message %>
|