Skip to content

Conversation

@halahaddad1
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 manages the database
Describe in your own words what the Controller is doing in Rails It coordinates the interactions between the view and the models
Describe in your own words what the View is doing in Rails Shares data with the browser and the controller
Describe an edge-case controller test you wrote One example is to test that the test saves a new task in the create task page, and what happens if it doesn't save.
What is the purpose of using strong params? (i.e. the params method in the controller) It's the rails way of getting saved variables to our controller actions.
How are Rails migrations related to Rails models? Migrations update our database, the database updates rely on the model to specify the layout, so migrations are streamlined by the model.
Describe one area of Rails that are still unclear on I think everything in rails is still very much raw and writing code feels like stepping on egg shells, every step breaks something, it will take more practice to be sure about more complex actions. the toggle complete/not complete action for example took a whole day for me to figure out! looking forward to becoming more confidant writing actions in rails.

Comment on lines +1 to +5
# TASKS = [
# {task: "Clean the dishes"},
# {task: "Take out the trash"},
# {task: "Take the kids to the park"}
# ]

Choose a reason for hiding this comment

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

Suggested change
# TASKS = [
# {task: "Clean the dishes"},
# {task: "Take out the trash"},
# {task: "Take the kids to the park"}
# ]

Can be deleted

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

Choose a reason for hiding this comment

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

Just a suggestion, include a status code:

Suggested change
render :new
render :new, status: :bad_request

redirect_to tasks_path
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

if @task.update(
completed_at: Date.today.to_s
)
redirect_to request.referrer

Choose a reason for hiding this comment

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

Nice!

<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>

<body>

Choose a reason for hiding this comment

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

I suggest putting navigation links here like maybe a link to create a new task, and view all tasks.

@@ -0,0 +1,15 @@
<%= 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 know this isn't required for Task List, just noting that for future projects you can DRY up this form code with a partial view.

<div class="">
<% @tasks.each do |task| %>
<div class="dl-horizontal">
<% css_class = (task.completed_at.nil? || task.completed_at.empty?) ? 'nostrike' : 'strike' %>

Choose a reason for hiding this comment

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

I like this.

<h1><%= @task.name %></h1>
<p>: <%= @task.description %></p>
<p> <%= @task.completed_at %></p>
<%= link_to "Edit", edit_task_path(@task), class:"btn btn-info" %>

Choose a reason for hiding this comment

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

I suggest using the strikethrough styling here as well.

end
end

def update_completed_task

Choose a reason for hiding this comment

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

I also like the toggle.

@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 ✔️
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 ✔️

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?
Elegant/Clever
Descriptive/Readable
Concise
Logical/Organized

Summary

Nicely done, you hit all the learning goals here. I like the styling you added here. Well done.

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