Updated code to be compatible with Rails 4, for the RailsCasts episode #196 Nested Model Form