Conversation
Task ListWhat We're Looking For
|
|
|
||
| def new | ||
| @new = Task.new | ||
| end |
There was a problem hiding this comment.
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.
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.
Your form is missing a submit button
|
|
||
| @task.title = params["task"]["title"], | ||
| @task.description = params["task"]["description"] | ||
|
|
There was a problem hiding this comment.
You should be using strong params here.
There was a problem hiding this comment.
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 |
|
|
||
| <%= render partial: 'form', locals: { | ||
| button_text: "Shelve it!" } %> | ||
|
|
There was a problem hiding this comment.
I don't think this local is relevant here.
Task List
Congratulations! You're submitting your assignment!
Comprehension Questions