首页
Python
Java
PHP
IOS
NodeJS
JavaScript
HTML5
小程序
AI
DoesSomethingWithActiveRecordUser
全部标签
ruby - 使用模块范围之外的对象
我有这样的代码。classUser如果我调用Foo::DoesSomethingWithActiveRecordUser.new(1),我会收到一条错误消息,内容类似于undefinedmethod'find'forFoo::User。如何从Foo中调用ActiveRecord用户?谢谢。 最佳答案 像这样:::User.find(user_id) 关于ruby-使用模块范围之外的对象,我们在StackOverflow上找到一个类似的问题: https://s
ruby
使用
section
code
DoesSomethingWithActiveRecordUser
ruby-on-rails-3
Home
Powered By IT.CAOLU.XIN
页面耗时:0.0511s