Skip to content

Water - Iris Lux#38

Open
iris-lux wants to merge 37 commits intoAda-C14:masterfrom
iris-lux:master
Open

Water - Iris Lux#38
iris-lux wants to merge 37 commits intoAda-C14:masterfrom
iris-lux:master

Conversation

@iris-lux
Copy link

@iris-lux iris-lux 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 A model contains the state and data of an application. In Rails it uses ActiveRecord to interact with the data and relationships contained in a relational database. It handles the business logic of the application.
Describe in your own words what the Controller is doing in Rails The controller handles client requests and acts as the middleperson between model and view.
Describe in your own words what the View is doing in Rails The view determines what the application will look like - it does not have access to business logic, only view logic.
Describe an edge-case controller test you wrote I wrote a test for the edge case for toggle_complete of an invalid id (-1) being passed as part of the path for patch.
What is the purpose of using strong params? (i.e. the params method in the controller) Strong params are a secure way of giving access to the params hash. They prevent users from updating parameters that they should not updated.
How are Rails migrations related to Rails models? A migration alters/updates the database schema of a Rails model.
Describe one area of Rails that are still unclear on I'm still a little unclear on why strong params are necessary. I'm also unclear on the difference between a Rails model and the relational database.

… button display. refactored html to include this
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 ✔️ Nice and descriptive!
Routes follow RESTful conventions ✔️ Nice use of nesting routes for toggle_complete
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 ✔️
Edit, Update tests pass with valid & invalid task ids ✔️
Successfully handles: Destroy, Task Complete ✔️
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 (nested routes) and create helper method to create a well written program with impeccable user experience. It is clear that the learning goals for this project were met. Keep up the hard work!

To answer the question about the relational database vs. the model (I realize this may have already been answered this past week), the database is where the data is actually stored whereas the model is the blueprint and the functionality for that database. I'd be happy to discuss more in our 1:1 this week.

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

@@ -0,0 +1,19 @@
<main>

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.


private

def action_success_check(action, redirect_path)

Choose a reason for hiding this comment

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

Wow, nice use of a custom method! You may be interested in reading about controllor filters.


redirect_to tasks_path and return if task.nil?

if task.completed_at

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.

Comment on lines +2 to +8
def display_task_completed_at(completed_at)
return completed_at ? "Completed: #{completed_at.to_formatted_s(:twelvehr_long_ordinal)}" : "In Progress"
end

def complete_button_text(completed_at)
return completed_at ? "Mark In-Progress" : "Mark Complete"
end

Choose a reason for hiding this comment

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

Nice us of the ternary operator and helper methods to make for great user experience.

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