Review

It looks like line 32 prevents a user from loading a dog they don't own into the edit form. But this "update" method allows a malicious user to pass in any id and update any dog, without any check that the dog belongs to that user. You should make that check here.