-
Notifications
You must be signed in to change notification settings - Fork 43
Gale Harrington - Carets #26
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
base: master
Are you sure you want to change the base?
Conversation
Task ListWhat We're Looking ForHello Gale, Dee & I are swapping for feedback and 1-1s for the Rails unit, so I'll be doing your feedback until the JavaScript unit.
|
CheezItMan
left a comment
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.
Some minor comments.
| end | ||
|
|
||
| def create | ||
| @task = Task.new( name: params[:task][:name], description: params[:task][:description], date: params[:task][:date], completion_date: nil ) |
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 is a good place for strong params
| end | ||
|
|
||
| def show | ||
| @task = Task.find( params[:id].to_i ) |
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 would suggest having some sort of if statement here for if the task doesn't exist and redirecting them when that happens. The same would apply for edit, create, update and delete.
| task.completion_date = nil | ||
| end | ||
|
|
||
| task.save |
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 would also suggest checking just to make sure it saved correctly.
| @@ -0,0 +1,28 @@ | |||
| <body> | |||
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 is done in the layout file, not in the views.
Task List
Congratulations! You're submitting your assignment!
Comprehension Questions