I have a form that submits the form content, part of the data inserted into the content table, some attachments (document), and the need to insert another table separately.
(Some may be another table). Consider that document is an associated attribute of the content (which can be found through content). In this case, I'm inside the controller.
Use
content.save(contents)
Method will hide the details of the document better?
or through the
if(has(document)) then file.save(documents)
Is this a better way?
Reply content:
I have a form that submits the form content, part of the data inserted into the content table, some attachments (document), and the need to insert another table separately.
(Some may be another table). Consider that document is an associated attribute of the content (which can be found through content). In this case, I'm inside the controller.
Use
content.save(contents)
Method will hide the details of the document better?
or through the
if(has(document)) then file.save(documents)
Is this a better way?