Skip to content

Conversation

@RebeccaRoach
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 Rails Model is the database where all of the data that we want to persist is stored. The model allows us to create certain database schema and use this schema to keep track of our data for each record (instance of our Task class).
Describe in your own words what the Controller is doing in Rails The Rails Controller is the "brain" of our application. In the controller, we write the logic we want to implement with the various methods defined in the routes file. The controller communicates with the model and view separately, getting the data necessary for the particular request from the model, and then passing along that data to render in the view.
Describe in your own words what the View is doing in Rails The Rails View is what a user sees (html) and can interact with on the screen - it is the UI rendered. The view receives data from the controller after communicating with the model database. In this project, an example of a view is the show page for each task, with only one task's information rendered to the screen. Partials can help dry up view code for forms and any other repeated code we want.
Describe an edge-case controller test you wrote Though I wasn't able to implement optional controller tests for this assignment in time, an edge-case might be to check if the edit method responds with a redirect when attempting to edit a task that doesn't exist.
What is the purpose of using strong params? (i.e. the params method in the controller) Using strong params as a private method in a class allows us to only permit certain form data for an instance of that class to be submitted. It helps with security to make sure no one can submit additional unwanted fields.
How are Rails migrations related to Rails models? When we create a new Rails migration, we are defining the schema: the columns and data type in these columns. In essence, we are defining the shape and content of the model (our database) that communicates with the controller. Any time we want to change the data type of a column, we have to create a new migration (carefully because this will permanently make changes).
Describe one area of Rails that are still unclear on I'm still a bit unclear on testing database changes in Rails (more practice will be beneficial!), but also about how multiple models and controllers can be used to create a more robust application. Navigating the file architecture amongst multiple models will be trickier but insightful in order to see how different pieces of an app interact to deliver a certain user experience.

Copy link

@kaidamasaki kaidamasaki left a comment

Choose a reason for hiding this comment

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

Great job! Here are a few small things you can do to clean up your code.

# patch '/tasks/:id', to: 'tasks#update', as: 'update_task'
# delete '/tasks/:id', to: 'tasks#destroy', as: 'destroy_task'

post '/tasks/:id', to: 'tasks#mark_complete', as: 'mark_complete'

Choose a reason for hiding this comment

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

I would recommend making this its own distinct endpoint (like you did with uncomplete) just to make it clearer what this does:

Suggested change
post '/tasks/:id', to: 'tasks#mark_complete', as: 'mark_complete'
post '/tasks/:id/complete', to: 'tasks#mark_complete', as: 'mark_complete'

return
else
@task.update(
completed_at: Time.now.strftime("%I:%M %p on %m/%d/%Y")

Choose a reason for hiding this comment

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

I'd generally recommend setting this as the actual time option and having it stored in the database as a datetime.

create_table :tasks do |t|
t.string :name
t.string :description
t.date :completed_at

Choose a reason for hiding this comment

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

You should use t.datetime for this column.

@kaidamasaki
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 ✔️
Yellow (Approaches Standards) 3+ in Code Review && 4+ in Functional Requirements, or the instructor judges that this project needs special attention
Red (Not at Standard) 0-2 in Code Review or 0-3 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
Concise
Logical/Organized

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