-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ports - Amy W #37
base: master
Are you sure you want to change the base?
Ports - Amy W #37
Conversation
Task ListWhat We're Looking For
Great work on this project, Amy! This project looks great; it meets the requirements on using Rails best practices, RESTful routing, and CRUD operations. One place that this could improve would be refactoring things such that the form is pulled into a partial views. I also have a few comments on the code. There is actually an interesting bug in your project. To recreate:
I have a comment that shows why this bug happens Otherwise, well done! Good work |
@@ -0,0 +1,86 @@ | |||
class TasksController < ApplicationController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This controller is named correctly, but weirdly enough, I'd expect your file name to be tasks_controller.rb
, not capitalized like how it currently is (Tasks_controller
)
description: params["task"]["description"], | ||
complete: params["task"]["complete"], | ||
complete_date: params["task"]["complete_date"], | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably refactor this to use the strong params, so Task.new(task_params)
here instead of this hash
COMPLETION DATE: <%= task.complete_date %> | ||
<br> | ||
<%= link_to "View Task", task_path(task.id) %> | ||
<% if task.complete == false %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, you are checking specifically if task.complete
is equal to false
. However, the default value for task.complete
for a new task ends up being nil
. Therefore, this conditional ends up incorrectly displaying
Task List
Congratulations! You're submitting your assignment!
Comprehension Questions