質問編集履歴
2
エラー
test
CHANGED
File without changes
|
test
CHANGED
@@ -457,3 +457,9 @@
|
|
457
457
|
</div>
|
458
458
|
|
459
459
|
```
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
エラー詳細
|
464
|
+
|
465
|
+
![エラー](f26b9138b584d46224e1695f83746edf.png)
|
1
eeeeeeee
test
CHANGED
File without changes
|
test
CHANGED
@@ -196,18 +196,102 @@
|
|
196
196
|
|
197
197
|
```
|
198
198
|
|
199
|
+
<%= link_to "トップページへ戻る",root_path %>
|
200
|
+
|
201
|
+
<div class="myname">
|
202
|
+
|
203
|
+
<h2><%= "#{@user.nickname}さんのプロフィール"%><h2>
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<%= render "users/stats" %>
|
208
|
+
|
199
209
|
<% if @user.id == current_user.id && @mypages.blank? %>
|
200
210
|
|
201
211
|
<%= link_to "プロフィール作成",new_mypage_path %>
|
202
212
|
|
203
213
|
<% elsif @user.id == current_user.id || current_user.admin %>
|
204
214
|
|
205
|
-
<%= link_to "プロフィール編集",edit_mypage_path %>
|
215
|
+
<%= link_to "プロフィール編集",edit_mypage_path(@user) %>
|
206
|
-
|
207
|
-
<%#= link_to "プロフィール編集","/mypages/#{@mypages.id}/edit"> これにしてもダメ
|
208
216
|
|
209
217
|
<% end %>
|
210
218
|
|
219
|
+
</div class="myprof">
|
220
|
+
|
221
|
+
<% @mypages.each do |mypage| %>
|
222
|
+
|
223
|
+
<div class="residence">
|
224
|
+
|
225
|
+
<p>住んでる場所<p>
|
226
|
+
|
227
|
+
<br>
|
228
|
+
|
229
|
+
<%=mypage.prefectures %>
|
230
|
+
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="text-myname">
|
234
|
+
|
235
|
+
<p>自己紹介</p>
|
236
|
+
|
237
|
+
<br>
|
238
|
+
|
239
|
+
<%=mypage.text %>
|
240
|
+
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div class="my-links">
|
244
|
+
|
245
|
+
<%= link_to "投稿した試合記事","#{mypage.user_id}/my_tweets",class: "my-link" %>
|
246
|
+
|
247
|
+
<%= link_to "投稿した戦力分析","#{mypage.user_id}/my_analyses",class: "my-link" %>
|
248
|
+
|
249
|
+
<%= link_to "投稿した試合予想","#{mypage.user_id}/my_forecasts",class: "my-link" %>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<%end%>
|
254
|
+
|
255
|
+
</div>
|
256
|
+
|
257
|
+
<% if @user.id != current_user.id %>
|
258
|
+
|
259
|
+
<% if @isRoom == true %>
|
260
|
+
|
261
|
+
<% if current_user.following?(@user) %>
|
262
|
+
|
263
|
+
<div class="dm">
|
264
|
+
|
265
|
+
<%= link_to 'ダイレクトメッセージをする', room_path(@roomId) %>
|
266
|
+
|
267
|
+
</div>
|
268
|
+
|
269
|
+
<% end %>
|
270
|
+
|
271
|
+
<% else %>
|
272
|
+
|
273
|
+
<%= form_for @room do |f| %>
|
274
|
+
|
275
|
+
<%= fields_for @entry do |e|%>
|
276
|
+
|
277
|
+
<% e.hidden_field :user_id, value: @user.id %>
|
278
|
+
|
279
|
+
<% end %>
|
280
|
+
|
281
|
+
<%= f.submit "DMを開始する"%>
|
282
|
+
|
283
|
+
<% end %>
|
284
|
+
|
285
|
+
<% end %>
|
286
|
+
|
287
|
+
<% end %>
|
288
|
+
|
289
|
+
</div>
|
290
|
+
|
291
|
+
<%= render "users/follow_form" %>
|
292
|
+
|
293
|
+
|
294
|
+
|
211
295
|
```
|
212
296
|
|
213
297
|
|
@@ -216,7 +300,131 @@
|
|
216
300
|
|
217
301
|
```
|
218
302
|
|
303
|
+
<div class="game-article">
|
304
|
+
|
305
|
+
<div class="choose-btn">
|
306
|
+
|
307
|
+
<% if current_user.id == @tweet.user_id || current_user.admin? %>
|
308
|
+
|
309
|
+
<%= link_to "記事を削除する","/tweets/#{@tweet.id}",method: :delete,data: { confirm: '削除しますか?' },class: "delete-article"%>
|
310
|
+
|
311
|
+
<%= link_to "記事を編集する","/tweets/#{@tweet.id}/edit",method: :get,class: "edit-article" %>
|
312
|
+
|
313
|
+
<% end %>
|
314
|
+
|
315
|
+
<%= link_to "記事一覧へ戻る",tweets_path,class: "return-top"%>
|
316
|
+
|
317
|
+
</div>
|
318
|
+
|
319
|
+
<div class="user_name">
|
320
|
+
|
219
|
-
<h4>投稿者 <%= link_to "#{@tweet.user.nickname}","/mypages/#{@tweet.user_id}"%></h4>
|
321
|
+
<h4>投稿者 <%= link_to "#{@tweet.user.nickname}","/mypages/#{@tweet.user_id}"%></h4>
|
322
|
+
|
323
|
+
</div>
|
324
|
+
|
325
|
+
<div class="game_result">
|
326
|
+
|
327
|
+
<%=@tweet.school_a.name%>
|
328
|
+
|
329
|
+
<%=@tweet.school_a_score%>
|
330
|
+
|
331
|
+
<a>-</a>
|
332
|
+
|
333
|
+
<%=@tweet.school_b_score%>
|
334
|
+
|
335
|
+
<%=@tweet.school_b.name%>
|
336
|
+
|
337
|
+
</div>
|
338
|
+
|
339
|
+
<div class="sub_title">
|
340
|
+
|
341
|
+
<%=@tweet.title_info%>
|
342
|
+
|
343
|
+
</div>
|
344
|
+
|
345
|
+
<div class=texts>
|
346
|
+
|
347
|
+
<%= simple_format(@tweet.text)%>
|
348
|
+
|
349
|
+
</div>
|
350
|
+
|
351
|
+
<div class="image">
|
352
|
+
|
353
|
+
<%= image_tag "#{@tweet.image}"%>
|
354
|
+
|
355
|
+
<% if current_user.already_liked?(@tweet)%>
|
356
|
+
|
357
|
+
<%= button_to "#{@tweet.likes.count}いいね",tweet_like_path(@tweet),class: "good-after",method: :delete%>
|
358
|
+
|
359
|
+
<% else %>
|
360
|
+
|
361
|
+
<%= button_to "#{@tweet.likes.count}いいね",tweet_likes_path(@tweet),{class: "good"}%>
|
362
|
+
|
363
|
+
<% end %>
|
364
|
+
|
365
|
+
<h2>いいねしたユーザー</h2>
|
366
|
+
|
367
|
+
<% @tweet.liked_users.each do |user|%>
|
368
|
+
|
369
|
+
<li><%=user.nickname%></li>
|
370
|
+
|
371
|
+
<% end %>
|
372
|
+
|
373
|
+
</div>
|
374
|
+
|
375
|
+
</div>
|
376
|
+
|
377
|
+
<div class="comments">
|
378
|
+
|
379
|
+
<h4><コメント一覧></h4>
|
380
|
+
|
381
|
+
<% if @comments %>
|
382
|
+
|
383
|
+
<% @comments.each do |comment| %>
|
384
|
+
|
385
|
+
<p>
|
386
|
+
|
387
|
+
<strong><%= comment.user.nickname %>:</strong>
|
388
|
+
|
389
|
+
<%= simple_format(comment.text) %>
|
390
|
+
|
391
|
+
<% if user_signed_in? && current_user.id == comment.user_id || current_user.admin %>
|
392
|
+
|
393
|
+
<%= link_to '削除', "/tweets/#{@tweet.id}/comments/#{comment.id}", method: :delete,class: "comment_delete_button" %>
|
394
|
+
|
395
|
+
<% end %>
|
396
|
+
|
397
|
+
<div class="comment_at">
|
398
|
+
|
399
|
+
<%= comment.created_at.strftime("%Y年%m月%d日 %H時%M分")%>
|
400
|
+
|
401
|
+
</div>
|
402
|
+
|
403
|
+
</p>
|
404
|
+
|
405
|
+
<% end %>
|
406
|
+
|
407
|
+
<% end %>
|
408
|
+
|
409
|
+
</div>
|
410
|
+
|
411
|
+
<div class="comment_container">
|
412
|
+
|
413
|
+
<!-- ここからフォーム -->
|
414
|
+
|
415
|
+
<% if current_user %>
|
416
|
+
|
417
|
+
<%= form_with(model:[@tweets, @comment], method: :post) do |f| %>
|
418
|
+
|
419
|
+
<textarea cols="30" name="text" placeholder="コメントを記述" rows="2"></textarea>
|
420
|
+
|
421
|
+
<input type="submit" value="SENT" class="game_record">
|
422
|
+
|
423
|
+
<% end %>
|
424
|
+
|
425
|
+
<% end %>
|
426
|
+
|
427
|
+
</div>
|
220
428
|
|
221
429
|
```
|
222
430
|
|