如果这是一个新手问题,请原谅我,但我想知道他们如何在此处的 User 模型中获得当前用户的 id:
清单 10.39
我已经尝试一遍又一遍地阅读它,但我仍然无法弄清楚:(
class User < ActiveRecord::Base
.
.
.
def feed
# This is preliminary. See "Following users" for the full implementation.
Micropost.where("user_id = ?", id)
end
.
.
.
end