質問編集履歴
2
htmlをformatterにてインデックス揃えました
test
CHANGED
File without changes
|
test
CHANGED
@@ -576,6 +576,8 @@
|
|
576
576
|
|
577
577
|
</div>
|
578
578
|
|
579
|
+
|
580
|
+
|
579
581
|
```
|
580
582
|
|
581
583
|
posts/show.html.erb
|
@@ -652,6 +654,10 @@
|
|
652
654
|
|
653
655
|
</div>
|
654
656
|
|
657
|
+
|
658
|
+
|
659
|
+
|
660
|
+
|
655
661
|
```
|
656
662
|
|
657
663
|
|
1
htmlの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -512,6 +512,150 @@
|
|
512
512
|
|
513
513
|
|
514
514
|
|
515
|
+
users/show.html.erb
|
516
|
+
|
517
|
+
```
|
518
|
+
|
519
|
+
<div class ="main user-show">
|
520
|
+
|
521
|
+
<div class= "container">
|
522
|
+
|
523
|
+
<div class= "user">
|
524
|
+
|
525
|
+
<%= image_tag "/#{@user.image_name}" %>
|
526
|
+
|
527
|
+
<h2><%= @user.name %></h2>
|
528
|
+
|
529
|
+
<p><%= @user.email %></p>
|
530
|
+
|
531
|
+
<% if @user.id == @current_user.id %>
|
532
|
+
|
533
|
+
<%= link_to("磨き", "/users/#{@user.id}/edit") %>
|
534
|
+
|
535
|
+
<% end %>
|
536
|
+
|
537
|
+
</div>
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
<ul class="user-tabs">
|
542
|
+
|
543
|
+
<li class= "active"><%= link_to("応援投稿","/users/#{@user.id}") %></li>
|
544
|
+
|
545
|
+
<li><%= link_to("それって、最高(いいね)", "/users/#{@user.id}/likes") %></li>
|
546
|
+
|
547
|
+
</ul>
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
<% @user.posts.each do |post| %>
|
552
|
+
|
553
|
+
<div class= "posts-index-item">
|
554
|
+
|
555
|
+
<div class= "post-left">
|
556
|
+
|
557
|
+
<%= image_tag "/#{post.user.image_name}" %>
|
558
|
+
|
559
|
+
<div class="post-right">
|
560
|
+
|
561
|
+
<div class= "post-user-name">
|
562
|
+
|
563
|
+
<%= link_to(post.user.name, "/users/#{post.user.id}")%>
|
564
|
+
|
565
|
+
</div>
|
566
|
+
|
567
|
+
<%= link_to(post.content, "/posts/#{post.id}") %>
|
568
|
+
|
569
|
+
</div>
|
570
|
+
|
571
|
+
</div>
|
572
|
+
|
573
|
+
<% end %>
|
574
|
+
|
575
|
+
</div>
|
576
|
+
|
577
|
+
</div>
|
578
|
+
|
579
|
+
```
|
580
|
+
|
581
|
+
posts/show.html.erb
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
```
|
586
|
+
|
587
|
+
<div class="main posts-show">
|
588
|
+
|
589
|
+
<div class="container">
|
590
|
+
|
591
|
+
<div class="posts-show-item">
|
592
|
+
|
593
|
+
<div class="post-user-name">
|
594
|
+
|
595
|
+
<%= image_tag "/#{@user.image_name}" %>
|
596
|
+
|
597
|
+
<%= link_to(@user.name, "/users/#{@user.id}") %>
|
598
|
+
|
599
|
+
</div>
|
600
|
+
|
601
|
+
<p>
|
602
|
+
|
603
|
+
<%= @post.content %>
|
604
|
+
|
605
|
+
</p>
|
606
|
+
|
607
|
+
<div class="post-time">
|
608
|
+
|
609
|
+
<%= @post.created_at %>
|
610
|
+
|
611
|
+
</div>
|
612
|
+
|
613
|
+
<% if Like.find_by(user_id: @current_user.id, post_id: @post.id) %>
|
614
|
+
|
615
|
+
<%= link_to("/likes/#{@post.id}/destroy",{method: "post"}) do %>
|
616
|
+
|
617
|
+
< span class= "fa fa-heart like-btn-unlike"></span>
|
618
|
+
|
619
|
+
<% end %>
|
620
|
+
|
621
|
+
<else>
|
622
|
+
|
623
|
+
<%= link_to("/likes/#{@post.id}/create",{method: "post"}) do %>
|
624
|
+
|
625
|
+
<span class= "fa fa-heart like-btn"></span>
|
626
|
+
|
627
|
+
<% end %>
|
628
|
+
|
629
|
+
<% end %>
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
<%= @likes_count %>
|
634
|
+
|
635
|
+
<% if @post.user_id == @current_user.id %>
|
636
|
+
|
637
|
+
<div class="post-menus">
|
638
|
+
|
639
|
+
<%= link_to("応援を強化する", "/posts/#{@post.id}/edit") %>
|
640
|
+
|
641
|
+
<%= link_to("応援をやめちゃう", "/posts/#{@post.id}/destroy", {method: "post"}) %>
|
642
|
+
|
643
|
+
</div>
|
644
|
+
|
645
|
+
<% end %>
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
|
650
|
+
|
651
|
+
</div>
|
652
|
+
|
653
|
+
</div>
|
654
|
+
|
655
|
+
```
|
656
|
+
|
657
|
+
|
658
|
+
|
515
659
|
|
516
660
|
|
517
661
|
|