LoginSignup
0
0

More than 3 years have passed since last update.

[Rails] deviseを使って現在ログインしているユーザーの情報を取得する

Last updated at Posted at 2020-10-11

回答

@user = current_userでOK

  def index
    @user = current_user
    @gears = Gear.where(user_id: @user.id)
  end

総括

deviseを使うとログイン周りが楽すぎる:metal:

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