谢谢 Jay。我得到的是:
[3] pry(main)> p=
[3] pry(main)* posts.first
=> #<Post:0x0000563a24cab908 id: 150>
[4] pry(main)> x=Post.find(p)
ArgumentError: You are passing an instance of ActiveRecord::Base tofind. Please pass the id of the object by calling.id.
from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.4.1/lib/active_record/relation/finder_methods.rb:467:in `find_one’
现在,告诉我关于这些包装的东西。这太烦人了,因为我知道 @Sam 的这个 rails 命令应该可以工作,但我认为 Rails 已经和那时不一样了: