Topic: One Form Two Model Create, Show all validations
I am having a problem with showing all the validations..
@user = User.new(params[:user])
@contact = Contact.new(params[:contact])
if @user.valid? && @contact.valid?
@user.contact = @contact
flash[:notice] = 'User was successfully created.'
redirect_to :action => 'list'
render :action => 'new'
My problem is only the first group of validations is showing up. If I leave a field on the contact object that blank and it fails validation, I get nothing shown to the screen. No errors are produced, the model just wont save.
How do I get all validations to appear as one group of validations for both models?