質問編集履歴
3
書式の改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -60,7 +60,7 @@
|
|
60
60
|
```js
|
61
61
|
$(document).on('turbolinks:load', function(){
|
62
62
|
$(function(){
|
63
|
-
//
|
63
|
+
// 大分類選択時のイベント処理
|
64
64
|
$('#parent-category').on('change', function(){
|
65
65
|
var parent_id = $('#parent-category').val();
|
66
66
|
if (parent_id != ''){
|
@@ -86,7 +86,7 @@
|
|
86
86
|
$('.grandchild-category').remove();
|
87
87
|
}
|
88
88
|
});
|
89
|
-
//
|
89
|
+
// 中分類選択時のイベント処理
|
90
90
|
$('.form-box__select').on('change', '#child-category', function(){
|
91
91
|
var child_id = $('#child-category').val();
|
92
92
|
if (child_id != ''){
|
@@ -118,7 +118,7 @@
|
|
118
118
|
var option = `<option value="${category.id}">${category.name}</option>`;
|
119
119
|
return option;
|
120
120
|
}
|
121
|
-
//
|
121
|
+
// 中分類のselectを生成
|
122
122
|
function appendChildren(categoryOptions){
|
123
123
|
var childSelector = '';
|
124
124
|
childSelector = `<div class="child-category">
|
@@ -128,7 +128,7 @@
|
|
128
128
|
</div>`;
|
129
129
|
$('.form-box__select').append(childSelector)
|
130
130
|
}
|
131
|
-
//
|
131
|
+
// 小分類のselectを生成
|
132
132
|
function appendGrandChildren(categoryOptions){
|
133
133
|
var grandchildSelector = '';
|
134
134
|
grandchildSelector = `<div class="grandchild-category">
|
2
タグの修正
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
1
初心者バッジの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
### 発生している問題・エラーメッセージ
|
20
20
|
エラー自体は発生していません。
|
21
21
|
しかし、SUBMITをした後のパラメーターを確認すると、ユーザーの選択に関係なくアペンドしたselectタグの先頭のカテゴリidが送信されています。
|
22
|
-
以下、binding.pryで確認した際の該当部分になります。
|
22
|
+
以下、binding.pryで確認した際の該当部分になります。
|
23
23
|
|
24
24
|
```
|
25
25
|
"item"=>{"name"=>"", "text"=>"", "category_id"=>"33", "condition"=>"", "shipping_fee"=>"", "shipping_from"=>"", "shipping_date"=>"", "price"=>""
|