我试图让用户(未登录)在点击“您的个人资料”后被定向到登录页面
class ProfileController < ApplicationController
before_action :authenticate_user!
def user_profile
render(:template => "profile/my_profile.html.erb")
end
end```
I tried to include "before_action :authenticate_user!" inside my controller for the profile but I received an error: undefined method `authenticate_user!'
I have a separate controller for authenticating the user