質問編集履歴

2

題名と内容の変更

2019/12/17 03:17

投稿

hiroro0820
hiroro0820

スコア13

test CHANGED
@@ -1 +1 @@
1
- goodボタンをAjaxで非同期処理にしたい、うくいかない
1
+ link_to のremote:true でjs 読み込ない
test CHANGED
@@ -10,7 +10,15 @@
10
10
 
11
11
  answerにgoodボタン、badボタンをつけるとこ
12
12
 
13
- までは、なんとか、できまし
13
+ までは、できたのですが
14
+
15
+
16
+
17
+ [railsとjsを使ったお手軽「いいね♡機能」
18
+
19
+ ](http://https://qiita.com/YuitoSato/items/94913d6a349a530b2ea2)
20
+
21
+ の記事を参考に
14
22
 
15
23
 
16
24
 
@@ -37,12 +45,6 @@
37
45
  読み込まれていないことが分かったのですが
38
46
 
39
47
  どうすればエラーが解決できるか全くわからず困っています。
40
-
41
-
42
-
43
- このエラーを解決するのに
44
-
45
- どうか、皆さんのお力を貸していただけると嬉しいです。
46
48
 
47
49
 
48
50
 
@@ -98,11 +100,11 @@
98
100
 
99
101
  @good.destroy
100
102
 
101
- redirect_to("/communities/#{params[:community_id]}/ques/#{params[:que_id]}/answers/#{params[:answer_id]}/show")
102
-
103
103
  end
104
104
 
105
105
  end
106
+
107
+
106
108
 
107
109
  ```
108
110
 
@@ -124,21 +126,21 @@
124
126
 
125
127
  <%#= good %>
126
128
 
127
- <div id="goods_buttons_<%= @answer.id %>">
129
+ <span id="good-of-<%= @answer.id %>">
128
130
 
129
- <%= render partial: 'goods/good', locals: { user_id: current_user.id, answer_id: @answer.id, community_id: @community.id, que_id: @que.id} %>
131
+ <%= render partial: 'goods/good', locals: { user_id: current_user.id, answer_id: @answer.id, community_id: @community.id, que_id: @que.id } %>
130
132
 
131
- </div>
133
+ </span>
132
134
 
133
135
 
134
136
 
135
137
  <%#= bad %>
136
138
 
137
- <div id="bads_buttons_<%= @answer.id %>">
139
+ <span id="bad-of-<%= @answer.id %>">
138
140
 
139
- <%= render partial: 'bads/bad', locals: { user_id: current_user.id, answer_id: @answer.id, community_id: @community.id, que_id: @que.id} %>
141
+ <%= render partial: 'bads/bad', locals: { user_id: current_user.id, answer_id: @answer.id, community_id: @community.id, que_id: @que.id } %>
140
142
 
141
- </div>
143
+ </span>
142
144
 
143
145
 
144
146
 
@@ -180,7 +182,7 @@
180
182
 
181
183
  ```ここに言語を入力
182
184
 
183
- $('#goods_buttons_<%= @answer.id %>').html("<%= j(render partial: 'goods/good', locals: {user_id: current_user.id, answer_id: @answer.id, community_id: @community.id, que_id: @que.id}) %>");
185
+ $("#good-of-<%= @answer.id %>").html("<%= j(render partial: 'good', locals: { user_id: current_user.id, answer_id: @answer.id, community_id: @community.id, que_id: @que.id }) %>")
184
186
 
185
187
  ```
186
188
 
@@ -188,6 +190,6 @@
188
190
 
189
191
  ```ここに言語を入力
190
192
 
191
- $('#goods_buttons_<%= @answer.id %>').html("<%= j(render partial: 'goods/good', locals: {user_id: current_user.id, answer_id: @answer.id, community_id: @community.id, que_id: @que.id}) %>");
193
+ $("#good-of-<%= @answer.id %>").html("<%= j(render partial: 'good', locals: { user_id: current_user.id, answer_id: @answer.id, community_id: @community.id, que_id: @que.id }) %>")
192
194
 
193
195
  ```

1

誤字

2019/12/17 03:17

投稿

hiroro0820
hiroro0820

スコア13

test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- いま、ついたアンサーにしてgoodかbadで評価できる機能を作っています。
7
+ いま、ついたアンサーにたいしてgoodかbadで評価できる機能を作っています。
8
8
 
9
9
 
10
10