我正在寻找一种解决方案,以便重用另一个使用 Authlogic 的 Web 应用程序的用户表。
我正在尝试使用 ActiveResource(在新应用程序中),但我遗漏了一些东西。这是不工作的代码:
#Existing app
class User < ActiveRecord::Base
attr_accessible :username, :email, :password
acts_as_authentic
end
#New app
class User < ActiveResource::Base
self.site="http://localhost:3001"
end
这个练习的真正目的是构建一个只有 Authlogic 的用户表的 web 服务。应该从许多应用程序中使用此 Web 服务。
任何人有任何提示?
编辑
是的,对不起,这是我认为的错误:
NoMethodError in Users#new
Showing app/views/users/_form.html.erb where line #5 raised:
undefined method `username' for #<User:0x103477bc0>