I currently have a line of code that works great for building objects that have has_many associations:
object_form_builder.object.send(type.to_sym).build
As you can likely appreciate, this does not work for belongs_to relationships, where the syntax needs to be build_obect rather than object.build.
Is there a way to reformat this code so that it will work with a belongs_to relationship?
You can simply do this: