Skip to content
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 - Heather #32

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Ports - Heather #32

wants to merge 9 commits into from

Conversation

piffer59
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 talks to external databases
Describe in your own words what the Controller is doing in Rails It is pulling the data from the Model using different actions.
Describe in your own words what the View is doing in Rails Displays the data that has been pulled by the Controller
Describe an edge-case controller test you wrote Returning a not found message when a task is not found.
What is the purpose of using strong params? (i.e. the params method in the controller) Helps to increase security, they prevent accidentally allowing users to update model attributes.
How are Rails migrations related to Rails models? migrations allow you to change your model
Describe one area of Rails that are still unclear on Testing Controller methods is still confusing

@tildeee
Copy link

tildeee commented Apr 22, 2019

Task List

What We're Looking For

Feature Feedback
Baseline
Appropriate Git Usage with no extraneous files checked in x
Answered comprehension questions x
Successfully handles: Index, Show x
Index & Show tests pass x
Successfully handles: New, Create x
New & Create tests pass x
Successfully handles: Edit, Update x
Tests for Edit & Update test valid & invalid task ids x
Successfully handles: Destroy, Task Complete x
Tests for Destroy & Task Complete include tests for valid and invalid task ids x
Routes follow RESTful conventions x
Uses named routes (like _path) x
Overall

Well done on this project, Heather!

Your project hits all the things I was looking for: following Rails best practices, RESTful routing, and CRUD.

The places of improvement that I have noted are:

  • You have defined a strong params method task_params, but you don't use it anywhere! Your project will be better off using the strong params method
  • You have a few unused lines of code

There are also just a few other comments I have

Also, you used some of the live code copy (like "MAKE! THAT! task!"), so don't forget to change small details like that to make this app your own :) :) :) (Not a big deal, just something that might feel nice for yourself)

That being said, your project looks pretty good. Great work!

{ name: "cleaning", description: "vacuum" },
{ name: "dinner", description: "make soup" },
{ name: "shopping", description: "Go to Target" },
]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to refactor your code often, so you remember to delete unused variables like this!

task = Task.new(
name: params["task"]["name"],
description: params["task"]["description"],
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a place where you can refactor this to use task_params instead of outlining name and description

end

def edit
puts params
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'd probably want to delete your puts!

end

def update
task = Task.find_by(id: params["id"])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strong params!

task = Task.find_by(id: params[:id])
task.toggle(:completed)
task.save
task.touch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this line do? Your tests still pass when I remove this line, and also the app still seems to work

<%else%>
<%= button_to "Mark Incomplete", mark_complete_path(task.id), method: :patch, class: "status-button" %>

<%end %>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this view and the logic in it looks good! You may want to mind your indentation though

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