When using model validation like presence: true it creates the register anyway because it uses the .create and not the .new in the create before saving.
Fix
Change the
def create
@<%= model %> = <%= model_camelize %>.create(params_for_model)
To
def create
@<%= model %> = <%= model_camelize %>.new(params_for_model)
When using model validation like presence: true it creates the register anyway because it uses the .create and not the .new in the create before saving.
Fix
Change the def create @<%= model %> = <%= model_camelize %>.create(params_for_model)
To def create @<%= model %> = <%= model_camelize %>.new(params_for_model)