While this will work, it would be easier to take advantage of SimpleForm here https://github.com/plataformatec/simple_form#associations