質問編集履歴
1
二点のうち、一点は解決したため
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Laravelの
|
1
|
+
Laravelのoldのoptionを見てselectedを変えたい
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
現在『更新』画面を作成中なのですが、
|
1
|
+
現在『更新』画面を作成中なのですが、お聞きしたいことがあります。
|
2
2
|
|
3
3
|
|
4
4
|
|
@@ -6,25 +6,11 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
0. 更新ボタンを押す→「The GET method is not supported for this route. Supported methods: POST.」とエラーが出る
|
10
|
-
|
11
9
|
|
12
10
|
|
13
11
|
0. optionがoldに対応して、selectedされない
|
14
12
|
|
15
|
-
|
16
|
-
|
17
|
-
1に関して、試したこと
|
18
|
-
|
19
|
-
<form method="POST" action="{{ route('memories.update', $memory->id) }}">
|
20
|
-
|
21
|
-
@csrf
|
22
|
-
|
23
|
-
@method('put')
|
24
|
-
|
25
|
-
などのように、 @method('put')を入れてみたが、できなかった。
|
26
|
-
|
27
|
-
|
13
|
+
様々なサイトを見たりして、同じように書いていますが、どうもうまく行きません。
|
28
14
|
|
29
15
|
|
30
16
|
|
@@ -180,6 +166,8 @@
|
|
180
166
|
|
181
167
|
<label>いつの思い出ですか?</label>
|
182
168
|
|
169
|
+
// ここら辺です。
|
170
|
+
|
183
171
|
<select class="form-control" name="category_id">
|
184
172
|
|
185
173
|
<option value="1" @if( old('category_id')=='1') selected @endif>中学生</option>
|