简体   繁体   English

Rails,间隙,在登录后使用用户ID?

[英]Rails, Clearance, using User ID after logging in?

I'm using clearance ( https://github.com/thoughtbot/clearance/wiki ) for authentication in my rails app. 我正在Rails应用程序中使用通关( https://github.com/thoughtbot/clearance/wiki )进行身份验证。 But I'm trying to figure out how to grab the user's ID in a view after logging in. 但是我试图找出登录后如何在视图中获取用户的ID。

Any ideas? 有任何想法吗?

Based on this , looks like 基于 ,看起来像

current_user.id

should do the trick. 应该可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM