Skip to content

Task-list project Gessica Mohr#44

Open
GeMath18 wants to merge 12 commits intoAda-C14:masterfrom
GeMath18:master
Open

Task-list project Gessica Mohr#44
GeMath18 wants to merge 12 commits intoAda-C14:masterfrom
GeMath18:master

Conversation

@GeMath18
Copy link

@GeMath18 GeMath18 commented Nov 2, 2020

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 in Rails contains the data for the application. It acts similar to Ruby classes. We have used the rails console to create instances of Model.
Describe in your own words what the Controller is doing in Rails The Controller gathers the data from the model and passes the data to the view to be displayed as HTML
Describe in your own words what the View is doing in Rails The View turns the data into HTML. It is what the user will see, the visual part.
Describe an edge-case controller test you wrote it will test that " will respond with not_found for invalid ids ".
What is the purpose of using strong params? (i.e. the params method in the controller) The params in controller is used to access the data. The param object acts like a hash, so we can access it using params[:symbol]
How are Rails migrations related to Rails models? Once we have generated our model with rails g model , we need to do a db:migrate so the db/schema knows about the changes.
Describe one area of Rails that are still unclear on Testing for update, destroy and complete actions.

Copy link

@beccaelenzil beccaelenzil left a comment

Choose a reason for hiding this comment

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

Task List

Major Learning Goals/Code Review

Criteria yes/no, and optionally any details/lines of code to reference
At least 6 commits with meaningful commit messages ✔️
Routes follow RESTful conventions ✔️ Consider using resources
Uses named routes (like _path) ✔️
Creates Models and migrations ✔️
Creates styled views This was not required, but something to consider for next time!
Handles errors like nonexistant tasks ✔️
Uses form_with to render forms in Rails ✔️

Functional Requirements/Manual Testing

Functional Requirement yes/no
Successfully handles index & show ✔️
index & show tests pass ✔️
Successfully handles: New, Create ✔️
New, Create tests pass ✔️
Successfully handles: Edit, Update ✔️
Edit, Update tests pass with valid & invalid task ids ✔️
Successfully handles: Destroy, Task Complete Add functionality to remark incomplete
Tests for Destroy & Task Complete include tests for valid and invalid task ids ✔️

Overall Feedback

Good work on task list! You successfully followed rails conventions to create your first app in rails. I've left a few inline comments for your to review. On your next project I encourage you to make use of additional tools and features including strong params, resources, and partial views. Keep up the hard work!

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 5+ in Code Review && 6+ in Functional Requirements ✔️
Yellow (Approaches Standards) 3+ in Code Review && 5+ in Functional Requirements, or the instructor judges that this project needs special attention
Red (Not at Standard) 0-2 in Code Review or 0-4 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging, or the instructor judges that this project needs special attention

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Descriptive/Readable
Logical/Organized

@@ -0,0 +1,16 @@
<%# in app/views/edit.html.erb %>

Choose a reason for hiding this comment

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

Not that this code is largely repeated for the new view. Consider using a partial view.

end
end

def toggle_complete

Choose a reason for hiding this comment

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

Consider how making two separate methods, for instance mark_complete and mark_incomplete would make this action idempotent.

Comment on lines +80 to +83
else
@task.update(completed_at: Time.now)
redirect_to tasks_path
return

Choose a reason for hiding this comment

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

You should also include capability to unmark a task complete.

head :not_found
return
else
@task.update(completed_at: Time.now)

Choose a reason for hiding this comment

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

Suggested change
@task.update(completed_at: Time.now)
if @task.complete_at.nil?
@task.update(completed_at: Time.now)
else
@task.update(completed_at: nil)
end

This will require some conditionals in your views additionally.

Comment on lines +12 to +13
<%= f.label :completed_at %>
<%= f.text_field :completed_at %>

Choose a reason for hiding this comment

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

Consider whether this value should be input in the form or set as a default to nil.

Comment on lines +190 to +194
expect {
patch toggle_complete_path(task.id)

# Assert
}.must_change "Task.count"

Choose a reason for hiding this comment

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

I am unsure why this test passes. Take a look. We should expect that marking complete does not change the number of tasks in the database.

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