我有我的轨道4应用程序中的这个ActiveModel。acts_as_api未定义的本地变量与ActiveModel ::模型
class MyModeltest
include ActiveModel::Model
acts_as_api
attr_accessor :title, :content
api_accessible :public do |template|
template.add :title
template.add :content
end
end
我把这种模式形成我的控制器,这返回一个错误:
undefined local variable or method `acts_as_api' for ...
所以,可能的下加载ActiveModel打电话acts_as_api? 如果是的话,你能告诉我这是怎么回事?
在此先感谢
更清楚,我的问题是不是静态变量acts_as_api,与宝石“acts_as_api”,如果你想使用里面的常量不被加载ActiveModel
嗨@chris_b,感谢您的回复,这项工作就像一个魅力。 我已经发布了关于acts_as_api的另一个问题,这是[link](http://stackoverflow.com/questions/19356290/format-xml-with-properties-with-acts-as-api),你能帮我吗? – cingusoft