Practice WOD: DigitsTextTemplate

The goal of this WOD is to refactor your Digits form template using the scala templates in play-example-form.

Create a new branch off of your latest digits application from the last module. Name this new branch “DigitsTextTemplate-1″, indicating that this is the first attempt at the DigitsTextTemplate WOD.

Instructions

Create a revised version of your Digits application in which you use the @text Scala template from the play-example-form system.

  1. Start your timer.
  2. Enable checkstyle.
  3. Create a views.bootstrap3 package.
  4. Copy the text.scala.html file into this package.
  5. Edit your NewContact.scala.html template to import this package, and replace the nested div’s for each form group by the @text template.
  6. Test your code by submitting correct and incorrect forms to ensure the behavior remains the same.
  7. To end the WOD, commit the working code to your branch.

When finished, stop your timer, and record how many minutes it took you to complete the WOD.

Rx: <8 min Av: 8-12 min Sd: 12-16 min DNF: 16+ min

Demonstration

Once you’ve finished doing the WOD a single time, watch me do it:

Standard WOD Caveats

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.

How to repeat the WOD

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.