rivsc / Beautiful-Scaffold

Rails generator for a complete and beautiful scaffold.
http://beautiful-scaffold.rivsc.ovh/
MIT License
74 stars 22 forks source link

Create action with problem when using validation #11

Closed fazelmk closed 9 years ago

fazelmk commented 9 years ago

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)

rivsc commented 9 years ago

Thanks. Fixed on the next version.