dimanche 31 janvier 2016

Form with has many relationship

What is the better way to create a model with has many relationship?

For example:

I have two models:

  • Client (id, name, ...)
  • Contact (id, type, value, description)

A client has many Contacts.

Example of create client view: http://ift.tt/1SRReB0

Problems:

  1. how to deal with validations?
  2. if validation fails, going back and fill in the contact with the respective errors?


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire