fabrik42/acts_as_api — Issue #49: resource written with plural unless
Author: apneadiving
Created: 2011-12-07 07:22:34+00:00
State: open

Hi,

I'm running accross a problem using:
* Rails 3.0.10
* acts_as_api 0.3.11
* Mongoid

Controller:

respond_with @project, :api_template => :v1_public

Model:

api_accessible :v1_public do |template|
Project.accessible_attributes.to_a.each do |key|
template.add key.to_sym
end
end

I wonder why, the rendered json is prepended with `projects` instead of `project`. Indeed, it recognizes it's not an array:

{"projects":
{
"name": "foo"
#other attributes of the lonely project here
}
}