500 internal server error with edit controller

Hello guys.i'm running through a big mess.I got 2 nested models .I use
awsome_nested_fields to handle nested forms.But when I hit edit, I get
a 500 internal server error.The code is too long to be written here so
f you will you can go to the link above to check it out.Thanks!!!

http://stackoverflow.com/questions/7946603/rails-500-internal-server-error-with-edit-controller