module InheritedResources::SingletonHelpers
def resource
So we have to call manager on it, not find.
Project.find(params[:project_id])
The association chain will be:
end
belongs_to :project, :singleton => true
class ManagersController < InheritedResources::Base
In singleton controllers:
chain. And this is what happened.
So you would just have to call find(:all) at the end of association
Project.find(params[:project_id]).tasks
In this case, the association chain would be:
end
belongs_to :project
class TasksController < InheritedResources::Base
end_of_association_chain here is not the same as in default belongs_to.
If you are going to overwrite it, you should notice that the
Overwrites how singleton deals with resource.
def resource get_resource_ivar || set_resource_ivar(end_of_association_chain.send(resource_instance_name)) end