How do I save my object in cfwheels and add data out of a form input field in the form of a comma separated list and save this data in a related table?
My form passes the data to the controler in the params struct. There is the field "tags" wich holds the values like "Apple,Pear,Banana".
How can I save this data to a second related table? Is it possible without a second query and without a transaction?
This is the simplified controller:
public void function create() {
news = model("News").new(params.news);
news.save()
}
The normal object data should go to the table news The related data to tags
I created the associations in both models.
based on the info you have provided it's hard to give more feedback than this:
You may need to include the post/get data, the models, as well as a description on what is the result and what is the expected result.