make nested_form work on rails4

Due to different way of naming nested fields introduced in this commit:
https://github.com/rails/rails/commit/47cbfbb98a2a4ccb6d434998183f24be4e2bb1c1#L1R1130 

nested_form stoped working - it was not adding middle part with either object id or timestamp. This commit may not be the best possible solution, but makes it work in rails4 and preserves compatibility with rails3