質問するログイン新規登録

質問編集履歴

1

エラーのスクショの追加、ファイル名の追加

2021/04/17 10:31

投稿

ttt452
ttt452

スコア4

title CHANGED
File without changes
body CHANGED
@@ -6,15 +6,15 @@
6
6
 
7
7
  ### 発生している問題・エラーメッセージ
8
8
 
9
- ```エラー
10
- NoMethodError in Books#create
9
+ ![イメージ説明](294076832e298c61c006e1f719bbcf7f.jpeg)
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.rb
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
- ```models/book.rb
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
- ```books_controller.rb
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 %>