I am writing a todo app, which track often repeated tasks. I have a CheckList model which has_many Tasks within it. Users can create a new CheckList and add Task to it as you normally would in Rails.
I would like users to also be able to create a checklist template (which would have its own Template model). This Template would be a representation (I'm thinking in JSON) of a CheckList and its Tasks, and I would like to be able to create a new CheckList and populate it's Tasks from it. That way they can just recreate the same checklist at different times.
Is there an easy way to accomplish this?
Is there any way to create a create_list_from_template method somewhere that would parse the template and create the CheckList and Tasks accordingly?
Am I going about this all wrong? Any suggestions appreciated...
EDIT
I will use NestedAttributes to create the tasks directly from a CheckList and that is fine. What I am specifically asking, is how can I create a CheckList from a Template.
How would I call and pass the creation of this new CheckList based on the JSON data contained in the Template model?
Is there a way to create a different new action on the CheckListsController, to which I could pass the Template data? Like a new_checklist_from_template action or something?