質問編集履歴

9

文章修正

2020/06/15 12:01

投稿

herisson0818
herisson0818

スコア3

test CHANGED
File without changes
test CHANGED
@@ -140,28 +140,6 @@
140
140
 
141
141
  ```
142
142
 
143
- 【scheme.rb】
144
-
145
-
146
-
147
-  create_table "tasks", force: :cascade do |t|
148
-
149
- t.string "name", limit: 30, null: false
150
-
151
- t.text "description"
152
-
153
- t.datetime "created_at", precision: 6, null: false
154
-
155
- t.datetime "updated_at", precision: 6, null: false
156
-
157
- end
158
-
159
- ```
160
-
161
-
162
-
163
- ```
164
-
165
143
  【user.rb】
166
144
 
167
145
 
@@ -183,3 +161,25 @@
183
161
  end
184
162
 
185
163
  ```
164
+
165
+
166
+
167
+ ```
168
+
169
+ 【scheme.rb】
170
+
171
+
172
+
173
+  create_table "tasks", force: :cascade do |t|
174
+
175
+ t.string "name", limit: 30, null: false
176
+
177
+ t.text "description"
178
+
179
+ t.datetime "created_at", precision: 6, null: false
180
+
181
+ t.datetime "updated_at", precision: 6, null: false
182
+
183
+ end
184
+
185
+ ```

8

文章修正

2020/06/15 12:01

投稿

herisson0818
herisson0818

スコア3

test CHANGED
File without changes
test CHANGED
@@ -3,8 +3,6 @@
3
3
  現在、Rubyでタスク管理アプリを製作しているものです。
4
4
 
5
5
  完成を間近にしてエラーにハマってしまっています。
6
-
7
- taskがない状況がマズいと思い、色々試しているのですが、解決に至りません。
8
6
 
9
7
  よろしければお力添えお願いいたします。
10
8
 

7

文章修正

2020/06/15 12:00

投稿

herisson0818
herisson0818

スコア3

test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  【エラーメッセージ】
18
18
 
19
- Showing /Users/lyla0818/task-manager/app/views/tasks/index.html.slim where line #11 raised:
19
+ Showing /Users/Username/task-manager/app/views/tasks/index.html.slim where line #11 raised:
20
20
 
21
21
 
22
22
 

6

2020/06/15 11:59

投稿

herisson0818
herisson0818

スコア3

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  現在、Rubyでタスク管理アプリを製作しているものです。
4
4
 
5
- 完成を間近にしてエラーにハマってしまっています。
5
+ 完成を間近にしてエラーにハマってしまっています。
6
6
 
7
7
  taskがない状況がマズいと思い、色々試しているのですが、解決に至りません。
8
8
 

5

user.rbを追加しました。

2020/06/15 11:41

投稿

herisson0818
herisson0818

スコア3

test CHANGED
File without changes
test CHANGED
@@ -159,3 +159,29 @@
159
159
  end
160
160
 
161
161
  ```
162
+
163
+
164
+
165
+ ```
166
+
167
+ 【user.rb】
168
+
169
+
170
+
171
+ class User < ApplicationRecord
172
+
173
+ has_secure_password
174
+
175
+
176
+
177
+ validates :name, presence: true
178
+
179
+ validates :email, presence: true, uniqueness: true
180
+
181
+
182
+
183
+ has_many :tasks
184
+
185
+ end
186
+
187
+ ```

4

文章修正

2020/06/15 11:29

投稿

herisson0818
herisson0818

スコア3

test CHANGED
File without changes
test CHANGED
@@ -2,13 +2,19 @@
2
2
 
3
3
  現在、Rubyでタスク管理アプリを製作しているものです。
4
4
 
5
- 完成を間近にしてエラー沼にハマってしまっています。よろしければお力添えお願いいたします。
5
+ 完成を間近にしてエラー沼にハマってしまっています。
6
+
7
+ taskがない状況がマズいと思い、色々試しているのですが、解決に至りません。
8
+
9
+ よろしければお力添えお願いいたします。
6
10
 
7
11
  エラー内容は以下の通りです。
8
12
 
9
13
  ![イメージ説明](7bd89420f574f0e8221e13804e95e54b.png)
10
14
 
11
15
  ```
16
+
17
+ 【エラーメッセージ】
12
18
 
13
19
  Showing /Users/lyla0818/task-manager/app/views/tasks/index.html.slim where line #11 raised:
14
20
 

3

エラー画面を追加しました。

2020/06/14 22:17

投稿

herisson0818
herisson0818

スコア3

test CHANGED
@@ -1 +1 @@
1
- 「PG::UndefinedColumn: ERROR: column tasks.user_id does not exist」でエラーが発生する
1
+ タスク管理アプリでエラー「PG::UndefinedColumn: ERROR: column tasks.user_id does not exist」
test CHANGED
@@ -1,4 +1,4 @@
1
- お世話になります。
1
+ お世話になります。Ruby初心者です。
2
2
 
3
3
  現在、Rubyでタスク管理アプリを製作しているものです。
4
4
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  エラー内容は以下の通りです。
8
8
 
9
-
9
+ ![イメージ説明](7bd89420f574f0e8221e13804e95e54b.png)
10
10
 
11
11
  ```
12
12
 

2

taskのschemeを追加しました。よろしくお願いします。

2020/06/14 22:13

投稿

herisson0818
herisson0818

スコア3

test CHANGED
File without changes
test CHANGED
@@ -131,3 +131,25 @@
131
131
  end
132
132
 
133
133
  ```
134
+
135
+
136
+
137
+ ```
138
+
139
+ 【scheme.rb】
140
+
141
+
142
+
143
+  create_table "tasks", force: :cascade do |t|
144
+
145
+ t.string "name", limit: 30, null: false
146
+
147
+ t.text "description"
148
+
149
+ t.datetime "created_at", precision: 6, null: false
150
+
151
+ t.datetime "updated_at", precision: 6, null: false
152
+
153
+ end
154
+
155
+ ```

1

2020/06/14 21:41

投稿

herisson0818
herisson0818

スコア3

test CHANGED
File without changes
test CHANGED
@@ -23,6 +23,8 @@
23
23
 
24
24
 
25
25
  発生箇所とされている箇所のコードは以下の通りです。こちらの11行目が指定されているエラー箇所です。
26
+
27
+ エラー箇所:- @tasks.each do |task|
26
28
 
27
29
  ```
28
30