Skip to content

Conversation

@katemyer
Copy link

@katemyer katemyer commented May 6, 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 database and knows the attributes of the data. It is similar to classes in Ruby.
Describe in your own words what the Controller is doing in Rails Controller is the central manager, taking in requests from the server, pulling in information from the data model, makes decisions, and hands information back to the view to render something back on the screen to the user.
Describe in your own words what the View is doing in Rails The views is where the html.erb files live. The ERB is a preprocessor and evaluates any Ruby expressions before sending to the browser. The View also handles the index.html which gets sent to the browser which is the view template.
Describe an edge-case controller test you wrote When the page was suppose to redirect to the main page after creating a new task.
What is the purpose of using strong params? (i.e. the params method in the controller) Strong params are used in controllers to make sure that users can't update sensitive model attributes. Strong params requires the use of explicit access to attributes that we can pass onto the model methods.
How are Rails migrations related to Rails models? Migrations are structured changes that can be made to a database schema. The schema is empty and lives in the model, the migration modifies it.
Describe one area of Rails that are still unclear on Not really sure...

@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 ✔️, yes, but I strongly suggest you avoid wave numbers for commit messages, instead describe the functionality you added.
Routes follow RESTful conventions ✔️
Uses named routes (like _path) ✔️
Creates Models and migrations ✔️, plus a seeds file!
Creates styled views ✔️, ERB is there, but no 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 You don't have the mark complete action

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

| Logical/Organized | ✅

Summary

Well done, you demonstrated a mastery of the actions we modeled in the ada books repository. Nice work. Do think for the next project how to run a nonstandard route like the mark complete action as it's an important learning goal. Otherwise excellent work.

#ORDER MATTERS!
#new task
# get '/tasks/new', to: 'tasks#new', as: 'new_task'
resources :tasks, only: [:index, :show, :create, :new, :edit, :update, :destroy]

Choose a reason for hiding this comment

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

I like that you're doing resources, but since you are using all 7 restful routes...

Suggested change
resources :tasks, only: [:index, :show, :create, :new, :edit, :update, :destroy]
resources :tasks

Comment on lines +105 to +109
# Act
get edit_task_path(-1)

# Assert
must_respond_with :redirect

Choose a reason for hiding this comment

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

👍

Comment on lines +1 to +8
# TASKS = [
# { name: "Kids", description: "Get more workbooks", completed_at: DateTime.now},
# { name: "Home", description: "Get more toothpaste"},
# { name: "Home", description: "Get coffee now"},
# { name: "Charlie", description: "Update shots"},
# { name: "Costco", description: "Toilet Paper"},
# { name: "Costco", description: "Chicken"},
# ]

Choose a reason for hiding this comment

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

Suggested change
# TASKS = [
# { name: "Kids", description: "Get more workbooks", completed_at: DateTime.now},
# { name: "Home", description: "Get more toothpaste"},
# { name: "Home", description: "Get coffee now"},
# { name: "Charlie", description: "Update shots"},
# { name: "Costco", description: "Toilet Paper"},
# { name: "Costco", description: "Chicken"},
# ]

redirect_to task_path(@task.id) #goes to page where task/:id page
return
else # save failed :(
render :new # 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.

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

redirect_to task_path # go to the index so we can see the book in the list
return
else # save failed :(
render :edit # show the new book form view again

Choose a reason for hiding this comment

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

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

<%= 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 you add navigation links for things like a home link and creating a new task.

@@ -0,0 +1,14 @@
<%= 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.

Just a note, we didn't assign this for task list, but in future projects you can dry up the forms with a partial view.

Time.at(rand * Time.now.to_i)
end

tasks = [

Choose a reason for hiding this comment

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

Nice!

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