LoginSignup
0
0

More than 3 years have passed since last update.

ログインしているとき(条件分岐)

Posted at

<% if user_signed_in? %>
A
<% end %>

ログインしているなら、Aを表示させる

<% if user_signed_in? && current_user.id == @tweet.user_id %>
B
<% end %>

ログインしていて、かつあなたのuser.idがそのツイートをしたuserのidと一致していたら(あなたがそのツイートの投稿主なら) Bを表示させる。

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