Oh, I think this is the reason why the detail view doesn't work. You don't have added this line in that method.