Conversation
…lay hard-coded tasks in tasks_controller.rb
…e rudimentary styles.
…action, added styles, cleaned for submission.
kaidamasaki
reviewed
May 5, 2020
kaidamasaki
left a comment
There was a problem hiding this comment.
Great job! Here are a few small things you can do to clean up your code.
| # patch '/tasks/:id', to: 'tasks#update', as: 'update_task' | ||
| # delete '/tasks/:id', to: 'tasks#destroy', as: 'destroy_task' | ||
|
|
||
| post '/tasks/:id', to: 'tasks#mark_complete', as: 'mark_complete' |
There was a problem hiding this comment.
I would recommend making this its own distinct endpoint (like you did with uncomplete) just to make it clearer what this does:
Suggested change
| post '/tasks/:id', to: 'tasks#mark_complete', as: 'mark_complete' | |
| post '/tasks/:id/complete', to: 'tasks#mark_complete', as: 'mark_complete' |
| return | ||
| else | ||
| @task.update( | ||
| completed_at: Time.now.strftime("%I:%M %p on %m/%d/%Y") |
There was a problem hiding this comment.
I'd generally recommend setting this as the actual time option and having it stored in the database as a datetime.
| create_table :tasks do |t| | ||
| t.string :name | ||
| t.string :description | ||
| t.date :completed_at |
There was a problem hiding this comment.
You should use t.datetime for this column.
Task ListMajor Learning Goals/Code Review
Functional Requirements/Manual Testing
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task List
Congratulations! You're submitting your assignment!
Comprehension Questions