質問編集履歴
3
画像を本文内に埋め込み
test
CHANGED
File without changes
|
test
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
|
39
39
|
↓ではなぜか消えてしまってます。(urlにstrを直接渡しても結果は同じです)
|
40
40
|
|
41
|
-
[結果1](
|
41
|
+
![結果1](216d0c17d178d7fcd2b1072a2a0f201f.png)
|
42
42
|
|
43
43
|
では、user_id以外ならどうか、例えばlocationも同じくdata属性から撮ってきてるので、user_idの部分をlocationにかえてみます。
|
44
44
|
|
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
↓結果
|
74
74
|
|
75
|
-
[結果2](
|
75
|
+
![結果2](8f6709cf6b98389fe9d8cc6d9829a71c.png)
|
76
76
|
|
77
77
|
|
78
78
|
|
@@ -114,7 +114,7 @@
|
|
114
114
|
|
115
115
|
↓結果
|
116
116
|
|
117
|
-
[結果3](
|
117
|
+
![結果3](ff1a9f7276669dd0fb491c89ff833dfa.png)
|
118
118
|
|
119
119
|
|
120
120
|
|
@@ -158,7 +158,7 @@
|
|
158
158
|
|
159
159
|
↓結果
|
160
160
|
|
161
|
-
[結果4](
|
161
|
+
![![結果4](20e023d0e0833ad39f0f3562edd26d82.png)](cf13bf332291e695c9ce541cac2e0dee.png)
|
162
162
|
|
163
163
|
|
164
164
|
|
2
コードを貼り付けた
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,31 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
+
```js
|
10
|
+
|
11
|
+
$('#user-search-result-body').on('click', '.cell-link', function() {
|
12
|
+
|
13
|
+
const user_id = $(this).data('user_id')
|
14
|
+
|
15
|
+
const location = $(this).data('location')
|
16
|
+
|
17
|
+
var str = `/users/locations/${location}/coming_locations/${user_id}/`
|
18
|
+
|
19
|
+
console.log(str)
|
20
|
+
|
21
|
+
$.ajax({
|
22
|
+
|
23
|
+
type: 'PATCH',
|
24
|
+
|
9
|
-
|
25
|
+
url: `/users/locations/${location}/coming_locations/${user_id}`,
|
26
|
+
|
27
|
+
cache: false
|
28
|
+
|
29
|
+
})
|
30
|
+
|
31
|
+
})
|
32
|
+
|
33
|
+
```
|
10
34
|
|
11
35
|
上記のajaxで渡しているURLのuser_idに当たる部分がconsole.logではとれているのにもかかわらず
|
12
36
|
|
@@ -20,7 +44,31 @@
|
|
20
44
|
|
21
45
|
|
22
46
|
|
47
|
+
```js
|
48
|
+
|
49
|
+
$('#user-search-result-body').on('click', '.cell-link', function() {
|
50
|
+
|
51
|
+
const user_id = $(this).data('user_id')
|
52
|
+
|
53
|
+
const location = $(this).data('location')
|
54
|
+
|
55
|
+
var str = `/users/locations/${location}/coming_locations/${user_id}/`
|
56
|
+
|
57
|
+
console.log(str)
|
58
|
+
|
59
|
+
$.ajax({
|
60
|
+
|
61
|
+
type: 'PATCH',
|
62
|
+
|
23
|
-
|
63
|
+
url: `/users/locations/${location}/coming_locations/${location}`,
|
64
|
+
|
65
|
+
cache: false
|
66
|
+
|
67
|
+
})
|
68
|
+
|
69
|
+
}
|
70
|
+
|
71
|
+
```
|
24
72
|
|
25
73
|
↓結果
|
26
74
|
|
@@ -38,7 +86,31 @@
|
|
38
86
|
|
39
87
|
|
40
88
|
|
89
|
+
```js
|
90
|
+
|
91
|
+
$('#user-search-result-body').on('click', '.cell-link', function() {
|
92
|
+
|
93
|
+
const user_id = $(this).data('user_id')
|
94
|
+
|
95
|
+
const location = $(this).data('location')
|
96
|
+
|
97
|
+
var str = `/users/locations/${location}/coming_locations/${user_id}/`
|
98
|
+
|
99
|
+
console.log(str)
|
100
|
+
|
101
|
+
$.ajax({
|
102
|
+
|
103
|
+
type: 'PATCH',
|
104
|
+
|
41
|
-
|
105
|
+
url: `/users/locations/${user_id}/coming_locations/${location}`,
|
106
|
+
|
107
|
+
cache: false
|
108
|
+
|
109
|
+
})
|
110
|
+
|
111
|
+
}
|
112
|
+
|
113
|
+
```
|
42
114
|
|
43
115
|
↓結果
|
44
116
|
|
@@ -58,7 +130,31 @@
|
|
58
130
|
|
59
131
|
|
60
132
|
|
133
|
+
```js
|
134
|
+
|
135
|
+
$('#user-search-result-body').on('click', '.cell-link', function() {
|
136
|
+
|
137
|
+
const user_id = $(this).data('user_id')
|
138
|
+
|
139
|
+
const location = $(this).data('location')
|
140
|
+
|
141
|
+
var str = `/users/locations/${location}/coming_locations/${user_id}/`
|
142
|
+
|
143
|
+
console.log(str)
|
144
|
+
|
145
|
+
$.ajax({
|
146
|
+
|
147
|
+
type: 'PATCH',
|
148
|
+
|
61
|
-
|
149
|
+
url: `/users/locations/${location}/coming_location/${user_id}`,
|
150
|
+
|
151
|
+
cache: false
|
152
|
+
|
153
|
+
})
|
154
|
+
|
155
|
+
}
|
156
|
+
|
157
|
+
```
|
62
158
|
|
63
159
|
↓結果
|
64
160
|
|
1
リンクをいれなおし
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
https://gyazo.com/f614caaacb0d8029a72cd551ed0cb0a2
|
9
|
+
[コード1](https://gyazo.com/f614caaacb0d8029a72cd551ed0cb0a2)
|
10
10
|
|
11
11
|
上記のajaxで渡しているURLのuser_idに当たる部分がconsole.logではとれているのにもかかわらず
|
12
12
|
|
@@ -14,19 +14,17 @@
|
|
14
14
|
|
15
15
|
↓ではなぜか消えてしまってます。(urlにstrを直接渡しても結果は同じです)
|
16
16
|
|
17
|
-
https://gyazo.com/4e93ac9ad9cb929059608fee2a6ed022
|
17
|
+
[結果1](https://gyazo.com/4e93ac9ad9cb929059608fee2a6ed022)
|
18
|
-
|
19
|
-
|
20
18
|
|
21
19
|
では、user_id以外ならどうか、例えばlocationも同じくdata属性から撮ってきてるので、user_idの部分をlocationにかえてみます。
|
22
20
|
|
23
21
|
|
24
22
|
|
25
|
-
https://gyazo.com/40cfb486c9a9a395a0b7dd559940c2a1
|
23
|
+
[コード2](https://gyazo.com/40cfb486c9a9a395a0b7dd559940c2a1)
|
26
24
|
|
27
25
|
↓結果
|
28
26
|
|
29
|
-
https://gyazo.com/40cfb486c9a9a395a0b7dd559940c2a1
|
27
|
+
[結果2](https://gyazo.com/40cfb486c9a9a395a0b7dd559940c2a1)
|
30
28
|
|
31
29
|
|
32
30
|
|
@@ -40,11 +38,11 @@
|
|
40
38
|
|
41
39
|
|
42
40
|
|
43
|
-
https://gyazo.com/6feb12176928f01a0141bd865f722e6e
|
41
|
+
[コード3](https://gyazo.com/6feb12176928f01a0141bd865f722e6e)
|
44
42
|
|
45
43
|
↓結果
|
46
44
|
|
47
|
-
https://gyazo.com/2ac79e366aca502149ca83dae6c1aaa3
|
45
|
+
[結果3](https://gyazo.com/2ac79e366aca502149ca83dae6c1aaa3)
|
48
46
|
|
49
47
|
|
50
48
|
|
@@ -60,11 +58,11 @@
|
|
60
58
|
|
61
59
|
|
62
60
|
|
63
|
-
https://gyazo.com/08d2fe4b00f775165d0c58723dab46c3
|
61
|
+
[コード4](https://gyazo.com/08d2fe4b00f775165d0c58723dab46c3)
|
64
62
|
|
65
63
|
↓結果
|
66
64
|
|
67
|
-
https://gyazo.com/11afa9d66eba3209cfa7b0147456163d
|
65
|
+
[結果4](https://gyazo.com/11afa9d66eba3209cfa7b0147456163d)
|
68
66
|
|
69
67
|
|
70
68
|
|