- Screenshots of scores will be posted in comments
- Screenshots of completed sections will be posted in comments
This exercise is intended to help you assess your progress with the concepts and techniques we've covered during the week.
For these questions, write a short snippet of code that meets
the requirement. In cases where the question mentions a "given"
data value, use the variable given
to refer to it (instead of re-writing
the information).
Define CRUD.
There are seven verb + path combinations that are necessary in a basic Sinatra app in order to provide full CRUD functionality. List each of the seven combinations, and explain what each is for.
Why do we use set method_override: true?
Explain the difference between value and name in this line: <input type='text' name='task[title]' value="<%= @task.title %>"/>.
What are params? Where do they come from?
##Hello World
Responder #1 - This responder took largely the same approach as me but used the "if/return true" approach rather than the single line return method. In this case I feel the one-line method is sufficiently clear and therefore would probably be preferred over using if/return.
Responder #2 - This user employed an even more broken-out approach than the first responder, creating a three part "if - else if - else" conditional. For the same reason as #1 I feel that the one-line approach would be preferred in this case.
Responder #3 - This user decided to build the logic out with a nested conditional, nesting the %100 and %400 checks within the %4 conditional. It appears cleaner at first glance and the nested structure does mirror the logic of the problem, though I know in a more complex situation a nested conditional could prove to be a real can of worms.