Skip to content

Fire-Kalki-Task-List#37

Open
KayKay-git wants to merge 9 commits intoAda-C14:masterfrom
KayKay-git:master
Open

Fire-Kalki-Task-List#37
KayKay-git wants to merge 9 commits intoAda-C14:masterfrom
KayKay-git:master

Conversation

@KayKay-git
Copy link

@KayKay-git KayKay-git 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 interacts with the db to get the requested information from the client.
Describe in your own words what the Controller is doing in Rails Once the controller recieves the clients request, it interacts with the model; to get the requested information from the db and passes that information to the view for rendering. Once rendered, the controller will send that response to the client.
Describe in your own words what the View is doing in Rails Renders the data in the format we normally see in webpages and sends it back to the controller.
Describe an edge-case controller test you wrote When the user enters invalid id, they get redirected.
What is the purpose of using strong params? (i.e. the params method in the controller) Security feature, helps to DRY up code. Still unclear about this one at the moment.
How are Rails migrations related to Rails models? Rails migrations will update the db. The rails model interacts with this db so any changes to the db will effect the model.
Describe one area of Rails that are still unclear on Some testing aspects.

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 ✔️
Uses named routes (like _path) ✔️
Creates Models and migrations ✔️
Creates styled views ✔️ Nice styles!
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 Note that when a task is created the view displays "mark incomplete"
Tests for Destroy & Task Complete include tests for valid and invalid task ids ✔️

Overall Feedback

Great work on this project! You've gone above and beyond to research new techniques (controller filters) and create helper method. It is clear that the learning goals around partial views, strong params, and applying styles to a rails app were met. I've left a few inline comments for you to review. 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
Elegant/Clever
Descriptive/Readable


new_task = Task.find_by(name: task_hash[:task][:name])

pp Task.all

Choose a reason for hiding this comment

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

Remember to remove printing from your test to add clarity to the test output.

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

Choose a reason for hiding this comment

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

Good use of a partial view.

<%= f.label :description %>
<%= f.text_field :description %> </br>

<%= f.label :completed_at %>

Choose a reason for hiding this comment

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

Note that because complete_at is entered when a task is created, a new task is already marked as complete and the button for mark_incomplete appears. This creates a bit of confusion for the user. Consider a design that doesn't have the user make an entry completed_at in the form.

<button><%= link_to "Edit", edit_task_path(task)%></button>
<button><%= link_to "Delete", task_path(task.id), method: :delete, data: {confirm: "Are you sure?"}%></button>

<% if task.completed_at == nil %>

Choose a reason for hiding this comment

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

Nice use of a conditional in a view. Consider using a ternary operator.

end
end

def 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.


private

def find_task

Choose a reason for hiding this comment

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

Good use of a helper method.

@@ -0,0 +1,95 @@
class TasksController < ApplicationController

before_action :find_task, except: [:index, :create]

Choose a reason for hiding this comment

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

Nice use of controller filters!

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