The purpose of this WOD is to show how with slight changes to your last WOD, you can create a CRUD application (well, almost, we won’t do Delete).
The UI will change as follows. The home page table should now include an “edit” link for each entry:
Clicking that edit link will pre-fill the New Contact page form with the data from that entry:
Editing that entry (such as changing ”Joe” to “Joseph”, then clicking “Add” results in the Joe Smith entry being updated (not the creation of an additional entry):
To get ready for this WOD, create a new branch off of a successfully completed branch from the DigitsModel WOD. Name this new branch “Attempt-N-N-N-N-1″, where N-N-N-N is the branch you’re going to base this WOD on. For example, if the branch “Attempt-2-2-2-2″ contains the DigitsModel code base that you want to build this WOD on, then create a branch called “Attempt-2-2-2-2-1″ to indicate that this is the first attempt (1) to extend the code from “Attempt-2-2-2-2″ to support models and dynamic output. (Yes, I know this naming scheme has gotten ridiculous. I will choose a better one in the next module.)
Support Create, Read, and Update for your digits application. You have already implemented Create and Read, so this WOD simply requires you to modify the existing code to support Update. Follow the approach described in the screencast of using an ID field to distinguish between new and pre-existing instances.
When finished, stop your timer, and record how many minutes it took you to complete the WOD.
Rx: <26 min Av: 26-40 min Sd: 40-50 min DNF: 50+ min
Once you’ve finished doing the WOD a single time, watch me do it:
You’ll learn significantly less from watching me solve the WOD if you haven’t attempted the WOD yourself first.
While it’s an achievement to finish the WOD no matter how long it takes, you might experience “diminishing returns” if you work longer than the DNF time. Thus, it might be strategic to stop working at the DNF time and watch my solution.
After watching my solution, I recommend that you repeat the WOD if you have not achieved at least Av performance. If so, be sure to:
Feel free to keep trying until you make Rx if that’s of interest to you.
To repeat the WOD, simply switch your local workspace branch to master, then create a new branch off of master called “Attempt-2″ (or whatever attempt you are on). Then, in the play console, type ; clean ; compile ; run
to clean the target directory, then recompile the system, then run the web application.