質問編集履歴
2
コード追加しています。
test
CHANGED
File without changes
|
test
CHANGED
@@ -228,6 +228,52 @@
|
|
228
228
|
|
229
229
|
```
|
230
230
|
|
231
|
+
```
|
232
|
+
|
233
|
+
routes.rb
|
234
|
+
|
235
|
+
Rails.application.routes.draw do
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
get 'sessions/new'
|
240
|
+
|
241
|
+
get 'sessions/create'
|
242
|
+
|
243
|
+
get 'sessions/destroy'
|
244
|
+
|
245
|
+
get 'login', to: 'sessions#new'
|
246
|
+
|
247
|
+
post 'login', to: 'sessions#create'
|
248
|
+
|
249
|
+
delete 'logout', to: 'sessions#destroy'
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
root to: 'tasks#index'
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
get 'signup', to: 'users#new'
|
258
|
+
|
259
|
+
resources :users, only: [:new, :create]
|
260
|
+
|
261
|
+
resources :tasks
|
262
|
+
|
263
|
+
end
|
264
|
+
|
265
|
+
コード
|
266
|
+
|
267
|
+
```
|
268
|
+
|
269
|
+
```
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
コード
|
274
|
+
|
275
|
+
```
|
276
|
+
|
231
277
|
[エラー画面]
|
232
278
|
|
233
279
|
(https://gyazo.com/a4095a668272271299c75d465c9071b5)
|
1
エラー内容追記しました。も
test
CHANGED
File without changes
|
test
CHANGED
@@ -228,4 +228,34 @@
|
|
228
228
|
|
229
229
|
```
|
230
230
|
|
231
|
+
[エラー画面]
|
232
|
+
|
231
|
-
|
233
|
+
(https://gyazo.com/a4095a668272271299c75d465c9071b5)
|
234
|
+
|
235
|
+
エラー内容
|
236
|
+
|
237
|
+
NoMethodError in Tasks#create
|
238
|
+
|
239
|
+
Showing /home/ec2-user/environment/tasklist/app/views/tasks/_form.html.erb where line #3 raised:
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
undefined method `to_model' for #<Task::ActiveRecord_AssociationRelation:0x0000000006c84a00>
|
244
|
+
|
245
|
+
Did you mean? to_xml
|
246
|
+
|
247
|
+
Extracted source (around line #3):
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
1<div class ="row">
|
252
|
+
|
253
|
+
2 <div class= "col-6">
|
254
|
+
|
255
|
+
3 <%= form_with(model: task, local: true) do |f| %>
|
256
|
+
|
257
|
+
4 <% if task.errors.any? %>
|
258
|
+
|
259
|
+
5 <div id="error_explanation" class ="alert alert-warning">
|
260
|
+
|
261
|
+
6 <ul>
|