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

Sockets - Shirley #26

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

Sockets - Shirley #26

wants to merge 8 commits into from

Conversation

shirley1chu
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 It contains the information, and likely organization and manipulation of the information that is needed for the program.
Describe in your own words what the Controller is doing in Rails It interprets the request from the browser and uses actions to get the needed information from the models. It them sends this information back to the browser.
Describe in your own words what the View is doing in Rails It displays the information sent by the controller to the user in the browser
Describe an edge-case controller test you wrote An attempt to destroy a non-existent task, the program redirects to the homepage.
What is the purpose of using strong params? (i.e. the params method in the controller) To "wrap" the parameters and reduce risk of errors when extracting attributes from the params hash.
How are Rails migrations related to Rails models? Migrations update changes in the data to the database, which then affect the attributes of the models (what attributes the model has, and the data type of these attributes)
Describe one area of Rails that are still unclear on There was a task.scss file for the Task controller. Was I supposed to do styling for all the pages on that one file, or make separate files for each specific webpage?

@CheezItMan
Copy link

Task List

What We're Looking For

Feature Feedback
Baseline
Appropriate Git Usage with no extraneous files checked in You should have more commits, but the commit messages are good.
Answered comprehension questions Check, models interface with the database. A view takes data from the controller and renders html to the browser. Part of the purpose of strong params is security. It prevents unanticipated fields being passed in. Migrations change the structure of the database, not the data exactly. Put styles that impact all the pages in the site in application.scss. In general that's where most of your styles will go.
Successfully handles: Index, Show Check
Index & Show tests pass Check
Successfully handles: New, Create Check
New & Create tests pass Check
Successfully handles: Edit, Update Check
Tests for Edit & Update test valid & invalid task ids Check
Successfully handles: Destroy, Task Complete Check, interesting way to do it with form_with, you can also do it with link_to or button_to.
Tests for Destroy & Task Complete include tests for valid and invalid task ids Check
Routes follow RESTful conventions Check
Uses named routes (like _path) Check
Overall Great work, you hit all the learning goals for this project. See my inline notes and let me know any questions you have.

@tasks = Task.all
end

def find_task

Choose a reason for hiding this comment

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

Great way to DRY up your code!

<% @tasks.each do |task| %>
<li>
<%= link_to ("♥ #{task.name}") , task_path(task), class: "task-name"%>
<%= form_with model: @task, url: complete_task_path(task), method: :patch do |f|%>

Choose a reason for hiding this comment

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

You could also do this with:

<%= button_to "#{task.completion_date ? 'Unmark Complete' : 'Mark Complete'}", complete_task_path(task), method: patch, class: "button" %>

# successfully rediredts
# Arrange
# Act
get edit_task_path(3456)

Choose a reason for hiding this comment

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

theoretically this could be a valid ID. Instead I suggest using -1 or "invalid id" as the ID for this test.

},
}

patch task_path(1234), params: task_data

Choose a reason for hiding this comment

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

similar to the above


it "returns a 404 if the task does not exist" do
# Arrange
task_id = 123456

Choose a reason for hiding this comment

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

ditto to the above

end

# Complete for Wave 4
describe "toggle_complete" do
# Your tests go here
describe "complete_toggle" do

Choose a reason for hiding this comment

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

Nice work on this!

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