Thanks for this video!
I have one doubt though, the `Math.floor(Math.random() * 20` has a high probability to repeat itself. In that case, only one record will be created. Why not generating a more complex number to avoid that ?
I wouldn't say high probability in the real world, but yes it would have a chance. one could use `new Date().valueOf()` instead, but it too could be duplicated if using a bot.
Lol, this is true. My apologies, I should have mentioned taking out `20` to a higher number like `Math.floor(Math.random() * 10000000000000000000)`. Running on fumes this morning.
Congratulations Kobaltz, everything worked properly and great stuff. Thanks for posting on Rails 6 already, a lot of good coming around.
A note (maybe) a little bug I found.
When entering edit mode of some list to do, I tried to do the inclusion of new lines or remove existing ones and it does not work.
No error is shown in console.log.
The add new record and delete events only work when I'm in the include mode of the to-do.
Hugs and good work.
I'm a newbie, but wondering if rather than doing the math equation, could you not generate some type of UUID instead? Thanks for making the video, a lot is still over my head, but it's great to watch and see how other people build things.
FYI, Deprecated Warning: Please replace data-target="nested-form.template" with data-nested-form-target="template". The data-target attribute is deprecated and will be removed in a future version of Stimulus.<template data-target="nested-form.template">
Please replace data-target="nested-form.add_item" with data-nested-form-target="add_item". The data-target attribute is deprecated and will be removed in a future version of Stimulus.<div data-target="nested-form.add_item">
Any idea's how to get a second nested form's fields in the _task_fields partial to render? in this example the nested car_field doesn't display on the main _form.
Please replace data-target="nested-form.template" with data-nested-form-target="template". The data-target attribute is deprecated and will be removed in a future version of Stimulus.<template data-target="nested-form.template">
Please replace data-target="nested-form.add_item" with data-nested-form-target="add_item". The data-target attribute is deprecated and will be removed in a future version of Stimulus.<div data-target="nested-form.add_item">
Any idea's how to get a second nested form's fields in the _task_fields partial to render? in this example the nested car_field doesn't display on the main _form.
# _task_fields.html.erb