Y
Y
yogaku2014-09-22 13:46:32
Ruby on Rails
yogaku, 2014-09-22 13:46:32

[Rails] How to properly implement nested form/field functionality?

There is an application that provides for filling in the "Phone Number" field. There may be several numbers.
On the view, phone numbers are displayed in different places.
What is the correct way to fill in this field?
I understand it is good practice to make a separate model. But after all not to create for each new such field model.
Model one. Field :phone

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vsuhachev, 2014-09-22
@yogaku

ActiveRecord has an array serialization into one column in the DBMS
. But if you need to have access to each phone separately (delete, change, search, etc.), then it is much more convenient to have a separate model

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question