Skip to content

Conversation

@KateAnnNichols
Copy link

Task List

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe in your own words what the Model is doing in Rails The Model handles the business logic and data.
Describe in your own words what the Controller is doing in Rails The Controller is the central coordination between user, views, and models.
Describe in your own words what the View is doing in Rails The View is presenting information to the user, using html and css.
Describe an edge-case controller test you wrote
What is the purpose of using strong params? (i.e. the params method in the controller) Strong params are used for security and to make sure that only valid parameters are used.
How are Rails migrations related to Rails models? Rails migrations facilitate changes to Rails models.
Describe one area of Rails that are still unclear on Styling

@droberts-sea
Copy link

Task List

What We're Looking For

Feature Feedback
Baseline
Appropriate Git Usage with no extraneous files checked in I do see you adding and committing through the command line, but there's definitely room for improvement here. Your commit messages should tell the reader a story about what changed when and why, without them having to dig through the code or project requirements.
Answered comprehension questions yes
Successfully handles: Index, Show yes
Successfully handles: New, Create no - neither the new nor create actions work as submitted
Successfully handles: Edit, Update no
Successfully handles: Destroy, Task Complete delete works, it looks like you started on toggle_complete but didn't finish
Existing tests pass some, but not all
Tests for edit, update, destroy, complete some, but not all
Routes follow RESTful conventions yes
Uses named routes (like _path) yes
Overall This is a good start, but it feels like there's a way to go before this is ready for submission. I see particular trouble around the new, create, edit and update actions, and it seems like working with forms and shepherding data through multiple request/response cycles is still a challenge. Being able to do this work quickly and accurately is going to be key for finding success over the next few weeks as we get deeper into our Rails unit, so it will be worthwhile to figure out a path to having this down.


def new
@new = Task.new
end

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>

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

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"]

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.

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

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!" } %>

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants