![airy airy](https://entp-lh-avatar-production.s3.amazonaws.com/avatars/67442/large.jpg?AWSAccessKeyId=AKIAJ4QBZRZBVMOUBNZA&Expires=2014628438&Signature=AF3%2Fn97I8Cshz%2BjtoDlAMYI%2BqNA%3D)
problem with polymorphic association nested in namespaced parents.
Reported by airy | December 24th, 2009 @ 10:25 PM
Hi,
my environment and code related with the problem are here: http://gist.github.com/263390
and i get this error:
Can't get singleton resource from class Catalog. You have have probably done something like:
nested_in :catalog, :singleton => true # <= where this is the first nested_in
You should tell resources_controller how to find the singleton resource like this:
nested_in :catalog, :singleton => true do
Catalog.find(<.. your find args here ..>)
end
Or:
nested_in :catalog, :singleton => true, :find => <..
method name or lambda ..>
Or, you may be relying on the route to load the resource, in
which case you need to give RC some
help. Do this by mapping the route segment to a resource in the
controller, or a parent or mixin
map_enclosing_resource :catalog, :segment => ..., :singleton => true <.. as above ..>
can you drive me to a solution for polymorphic associations nested in namespaced parents please?
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
resources_controller is a rails plugin that eases the pain of RESTful controllers.