开发者

Complex nested form rails 3 using nested_form gem

开发者 https://www.devze.com 2023-03-23 03:30 出处:网络
I have a problem and I don\'t know how to solve it. I\'m using \"nested_form\" gem in classic way so I\'m able to add \"multiple tasks\" to a \"project\" while I\'m creating a \"project\". That\'s no

I have a problem and I don't know how to solve it.

I'm using "nested_form" gem in classic way so I'm able to add "multiple tasks" to a "project" while I'm creating a "project". That's not the problem.

To explain the problem I'm going to use an example. Supose I have two models, "Projects" and "Tasks", where project has many tasks and task belongs to project. But in this case I can create a task without a project (foreign key could be null) and I want to make the association later.

So my idea is, when I create the project I want to associate tasks that already exists, so when i save the project, the foreign key in task should be the id of the project ju开发者_如何学Cst created

Is that possible??, hope you can help me, thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消