Skip to content

Conversation

@ktvoort123
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 in Rails is dealing with the data for the application and interacts with the database.
Describe in your own words what the Controller is doing in Rails The controller is the central processing of a rails app.
Describe in your own words what the View is doing in Rails The view takes in data and outputs HTML.
Describe an edge-case controller test you wrote N/A
What is the purpose of using strong params? (i.e. the params method in the controller) Strong params prevents assigning request parameters to objects unless they have been explicitly permitted.
How are Rails migrations related to Rails models? A Migration is a change to a database schema. The Model is a class that is being represented by the database schema.
Describe one area of Rails that are still unclear on I get the most confused in Rails differentiating what Rails does with its 'magic' and what I have to do.

@CheezItMan
Copy link

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 ✔️
Uses named routes (like _path) ✔️
Creates Models and migrations ✔️
Creates styled views ✔️, html is good not much styling
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 ✔️
Successfully handles: Destroy, Task Complete ✔️, I would suggest making this toggle between complete and incomplete tasks

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 5+ in Code Review && 5+ in Functional Requirements

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
Concise
Logical/Organized

Summary

Nicely done, you hit the learning goals here. You've definitely demonstrated an understanding of the lessons we modeled in Ada Books. Good luck with Rideshare!

@@ -0,0 +1,20 @@
Rails.application.routes.draw do

Choose a reason for hiding this comment

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

👍

Comment on lines +13 to +21
<h1>Welcome to Tasks List</h1>
<nav>
<ul>
<li><%= link_to "Create a new task", new_task_path %></li>
<li><%= link_to "View all tasks", tasks_path %></li>

</ul>
</nav>
</header>

Choose a reason for hiding this comment

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

I like this, but it should be the <body> tag.

@@ -0,0 +1,11 @@
<%= form_with model: @task, class: 'edit-task' do |f| %>

Choose a reason for hiding this comment

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

I realize this was reading after Task-List was due, but in future projects you can dry things up like this form with a partial view. Just a reminder.

<ul>
<%@tasks.each do |task|%>
<li>
<%= link_to task.name, task_path(task) %> <%= button_to "Delete Task", task_path(task), method: :delete, data: {confirm: "Are you sure?"}%> <%= button_to "Complete Task", task_complete_path(task), method: :patch%>

Choose a reason for hiding this comment

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

This is a really long line, maybe break this up over multiple lines.

redirect_to task_path(@task.id)
return
else
render :new, :bad_request # show the new task form view again

Choose a reason for hiding this comment

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

I just find this more readable, but I think yours is correct too.

Suggested change
render :new, :bad_request # show the new task form view again
render :new, status: :bad_request # show the new task form view again

redirect_to task_path(@task.id)
return
else
render :edit

Choose a reason for hiding this comment

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

Suggested change
render :edit
render :edit, status: :bad_request

redirect_to task_path(@task.id)
return
else
render :edit

Choose a reason for hiding this comment

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

Why render edit here? Maybe instead just redirect them someplace.

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