-
Notifications
You must be signed in to change notification settings - Fork 49
Kate N - Sockets #48
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?
Kate N - Sockets #48
Conversation
Task ListWhat We're Looking For
|
|
|
||
| def new | ||
| @new = Task.new | ||
| end |
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 define an instance variable @new, but your view code is looking for one called @task. As a result, your new task form doesn't work.
| <div> | ||
| <%= f.label :name, "Please enter a task name:"%> | ||
| <%= f.text_field :name, placeholder: "meal prep for breakfast"%> | ||
| </div> |
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 ask for a name, but the tasks table doesn't have a name column. Did you want title instead?
| <%= f.text_field :completion_date, placeholder: "Jan 1, 2020"%> | ||
| </div> | ||
|
|
||
| <% end %> No newline at end of file |
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.
Your form is missing a submit button
|
|
||
| @task.title = params["task"]["title"], | ||
| @task.description = params["task"]["description"] | ||
|
|
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.
You should be using strong params here.
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.
Also, you may have noticed your task names getting mangled as you save them to the database. That's a result of the trailing comma on line 26 - Ruby thinks you want to set @task.title to an array containing the rest of line 26 as well as all of line 27.
| # def.update( | ||
| # @task = Task.find(params[:id]) | ||
|
|
||
| # unless task |
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.
Why is this commented out?
|
|
||
| <%= render partial: 'form', locals: { | ||
| button_text: "Shelve it!" } %> | ||
|
|
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 don't think this local is relevant here.
Task List
Congratulations! You're submitting your assignment!
Comprehension Questions