0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

posts/show.html.erb

Posted at
"> <%= link_to(@user.name, "/users/#{@user.id}") %>

<%= @post.content %>

<%= @post.created_at %>
<% if Like.find_by(user_id:@current_user.id,post_id:@post.id) %> いいね!済み <% else %> いいね!していません <% end %>
  <% if @post.user_id == @current_user.id %>
    <div class="post-menus">
      <%= link_to("編集", "/posts/#{@post.id}/edit") %>
      <%= link_to("削除", "/posts/#{@post.id}/destroy", {method: "post"}) %>
    </div>
  <% end %>
</div>
投稿詳細ページで、その投稿にいいねしたかどうかを表示できるようにしましょう。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?