Topic: How to resolve "couldn't find 'model-name' with id=" error
My app runs fine if the nested resource has a record associating the parent resource, otherwise I get the error:
couldn't find QuestionResponse with id=2 [WHERE "question_responses"."question_id" = 2]
Not sure what is going wrong, but I made two demo apps in the same way (except that they used scaffolding) and they worked fine even if their was no child resource record associating to the parent resource, and I did need to put any condition.
In this app, I tried to put condition:
but the condition fails and the error shifts to the condition itself.
I have posted the code on Gist here: https://gist.github.com/2412177