質問編集履歴
2
ミスの訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -202,7 +202,7 @@
|
|
202
202
|
|
203
203
|
$('#like-text-post-<%= @post.id.to_s %>').
|
204
204
|
|
205
|
-
html('<%= j render "
|
205
|
+
html('<%= j render "posts/like_text", { likes: @post.likes } %>');
|
206
206
|
|
207
207
|
```
|
208
208
|
|
1
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -202,7 +202,47 @@
|
|
202
202
|
|
203
203
|
$('#like-text-post-<%= @post.id.to_s %>').
|
204
204
|
|
205
|
-
html('<%= j render "posts/like_text", { likes: @post.likes } %>');
|
205
|
+
html('<%= j render "../posts/like_text", { likes: @post.likes } %>');
|
206
|
+
|
207
|
+
```
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
```LikeaText
|
212
|
+
|
213
|
+
<strong>
|
214
|
+
|
215
|
+
<% likes.each.with_index do |like, index| %>
|
216
|
+
|
217
|
+
<% if likes.size == 1 %>
|
218
|
+
|
219
|
+
<%= like.user.name %></strong>が「いいね!」しました
|
220
|
+
|
221
|
+
<% elsif like == likes.last %>
|
222
|
+
|
223
|
+
</strong>and<strong>
|
224
|
+
|
225
|
+
<%= + like.user.name %></strong>が「いいね!」しました
|
226
|
+
|
227
|
+
<% elsif index > 1 %>
|
228
|
+
|
229
|
+
</strong><%= "and" + (likes.size-index).to_s + '他'%>が「いいね!」しました
|
230
|
+
|
231
|
+
<% break %>
|
232
|
+
|
233
|
+
<% elsif index == likes.size-2 || index == 1 %>
|
234
|
+
|
235
|
+
<%= like.user.name %>
|
236
|
+
|
237
|
+
<% else %>
|
238
|
+
|
239
|
+
<%= like.user.name + ',' %>
|
240
|
+
|
241
|
+
<% end %>
|
242
|
+
|
243
|
+
<% end %>
|
244
|
+
|
245
|
+
</strong>
|
206
246
|
|
207
247
|
```
|
208
248
|
|